I tried:
game.Workspace.PlayerNameHere.maxhealth=100
but i don't think thats the correct line. i already made a thread about this but none of the lines that were given to me worked ):
does it need a function?
You are referencing the player modal, to change the max health of a player, you need to reference the humanoid, like this: game.Workspace.PlayerNameHere.Humanoid.MaxHealth = 100
To give a player a certain amount of health when they join:
game.Players:PlayerAdded:Connect(function(player) player.Character:WaitForChild("Humanoid").MaxHealth = Number end)
try this
script:
game.Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(c) if p.Name == "YOURNAME" then c.Humanoid.MaxHealth = 150 end end) end)
Closed as Too Broad by RubenKan
This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.
Why was this question closed?