im trying to make an rpg and for the exp i am using and intvalue and i cant seem to get it to go into the player
game.Players.PlayerAdded:connect(function() local expe = Instance.new("IntValue") expe.Parent = game.Players.LocalPlayer expe.Value = 0
end)
Remember, LocalPlayer
can only be accessed by a LocalScript, and you have another error; Other then the LocalPlayer
, you left out something in your PlayerAdded event; the Player
, you forgot to specify the Player
in the function/event, let's fix up your script;
game.Players.PlayerAdded:connect(function(plr) --'plr' here will specify the Player that has joined the server/game local expe = Instance.new("IntValue") --Correct; this will create a new Instance [in this case, it will create the IntValue] expe.Parent = plr --This will set the Parent of 'expe' to 'plr' [the Player] expe.Value = 0 --This will set 'expe''s Value to 0 end) --This ends the code block for the event/function
Hope this helped!
game.Players.PlayerAdded:connect(function() local expe = Instance.new("IntValue") expe.Parent = game.Players.LocalPlayer expe.Value = 0 end)
To organize a Script, you need to put Code Blocks in, or press the Lua button before answering or making a post, the one in a blue bubble.
As for your question.. it looks right to me, but I can't be sure.
Locked by TheeDeathCaster, Redbullusa, and BlueTaslem
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?