of     1   

EMAN381
#40306354Tuesday, January 04, 2011 1:50 AM GMT

tool = script.Parent player = game.Players:GetPlayerFromCharacter(tool.Parent) ammo = tool.Ammo clips = tool.Clips txt = player.PlayerGui.gungui.GUI.AmmoValue --Keeps saying "Workspace.Pistol.guiscript:9: attempt to index global 'player' (a nil value)". What's wrong with my value? while true do txt.Text = txt.Text .. " " ..ammo.Value.. "/1 " ..clips.Value.. " Clips" wait(.1) end
BEART12
#40306627Tuesday, January 04, 2011 1:52 AM GMT

If your testing in studio then it can't find the player, try testing online
bloob827
#40307070Tuesday, January 04, 2011 1:58 AM GMT

If this is a tool, the tool would basically be in the character already.
HotThoth
Forum Moderator
#40307475Tuesday, January 04, 2011 2:02 AM GMT

Also, when your tool is not equipped by a player, this will break. If the tool is in the backpack, then your tool.Parent would be the backpack, so player will be nil. If the tool is lying on the floor somewhere, then tool.Parent would be game.Workspace (or some other model), so once again player will be nil.
EMAN381
#40338702Tuesday, January 04, 2011 8:34 PM GMT

Okay. Thanks. Never thought of that..

    of     1