Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Script that changes all players max health not working?

I am making an RPG game, and I am trying to change each player's max health to a higher number. But when I tried it didn't work. Here is the code.

game.Players.PlayerAdded:connect(function(Player) 
	Player.Character.Humanoid.MaxHealth = 1000
end

2 comments

0

I think you have to insert a local script because (client) and then it should work

0

No, I already tried that.

1 answer

✓ Accepted answer
game:GetService("Players").PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")

char:WaitForChild("Humanoid").MaxHealth = 100
end)
end)

try this instead, it waits for the humanoid first

This discussion is preserved as it was. New answers, comments, and votes are closed.