✓ Accepted answer
There are a few issues here. Veer is correct: PlayerAdded doesn't work with LocalScripts, at least not in a way you would expect, so this has to be done through a normal Script.
PlayerAdded when it fires returns the Player, not their Character, and it only fires once for each Player - when they first join the game. You have to use the CharacterAdded event to catch their respawns.
I'm not sure why you're using the StatusAdded event of Humanoid: nothing internally will fire it, since that associated RBXLibrary was never completed.
This code should work for you: In a Script, preferably in ServerScriptService:
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Char)
wait()
Char.Humanoid.MaxHealth = 500
Char.Humanoid.Health = Char.Humanoid.MaxHealth
end)
end)
1 comment
You can't use the 'PlayerAdded' event in a local script.