-2

# How do i instance a intvalue? [closed]

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)

0
its actually more organized than that i dont know what happened reloce 0 — 7y

### Locked by TheeDeathCaster, Redbullusa, and BlueTaslem

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

1

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!

0
    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.

game.Workspace.Players.PlayerAdded:connect(function(plr)