Im making a script that changes everyones max health to 50 but it did not work help?
game.Workspace.Player.Character.Humanoid.MaxHealth = 50
Im making a script that changes everyones max health to 50 but it did not work help?
game.Workspace.Player.Character.Humanoid.MaxHealth = 50
First the Player data is not stored in Workspace, Its stored in Players. And second you have to get all the players to do this you do:
players=game.Players:GetPlayers()
for i=1,#players do
players[i].Character.Humanoid.MaxHealth = 50
end
This should work
I'm not a good scripter, but I don't think you need Character and Humanoid. Try this. If it doesn't work, sorry. I suck at scripting..
game.Workspace.Player.Humanoid.MaxHealth = 50
Best of luck!
Actually, humanoid is a part of character or is found there. Nice try, though.
This discussion is preserved as it was. New answers, comments, and votes are closed.
9 comments
i did not work e.e
Do you have a function that starts it?
nope
You need to. It wont work without it
I Tried But I Can't Do It :/
When do you this event to trigger?
right after a teleport then i call out the function which is HpSet()
Then just include this section in the teleport script
put it right before the end of the function and after the teleporting part