Hello scripters! I have been trying to create an IntValue as soon as game.Players.PlayerAdded I wanted to make the value name "healthval" and Parent to be my local player. This is the code i tried using, but it did not work.
game.Players.PlayerAdded:connect(function(plr) Instance.new("IntValue").Parent = plr local healthval = plr:FindFirstChild("Value") healthval.Name = 'healthval' end)
game.Players.PlayerAdded:Connect(function(Player) --"Player" in the parenthesis is referring to the player that joined (your player). local val = Instance.new('IntValue') --Here, we need to make the value a variable so we can change its properties. val.Name = 'healthval' val.Value = 0 val.Parent = Player --It is always best to parent a object last. end)
If this helped, please be sure to accept and upvote my answer :)