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

Changing max health to everyone?

Im making a script that changes everyones max health to 50 but it did not work help?

game.Workspace.Player.Character.Humanoid.MaxHealth = 50

2 answers

✓ Accepted answer

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

9 comments

0

i did not work e.e

0

Do you have a function that starts it?

0

nope

0

You need to. It wont work without it

0

I Tried But I Can't Do It :/

0

When do you this event to trigger?

0

right after a teleport then i call out the function which is HpSet()

0

Then just include this section in the teleport script

0

put it right before the end of the function and after the teleporting part

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!

1 comment

0

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.