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
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
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.
2 comments
I think you have to insert a local script because (client) and then it should work
No, I already tried that.