Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Changing max health to everyone?

Asked by 9 years ago

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

Log in to vote
1
Answered by
parkderp1 105
9 years ago

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

0
i did not work e.e Anthony9960 210 — 9y
0
Do you have a function that starts it? parkderp1 105 — 9y
0
nope Anthony9960 210 — 9y
0
You need to. It wont work without it parkderp1 105 — 9y
View all comments (5 more)
0
I Tried But I Can't Do It :/ Anthony9960 210 — 9y
0
When do you this event to trigger? parkderp1 105 — 9y
0
right after a teleport then i call out the function which is HpSet() Anthony9960 210 — 9y
0
Then just include this section in the teleport script parkderp1 105 — 9y
0
put it right before the end of the function and after the teleporting part parkderp1 105 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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!

0
Actually, humanoid is a part of character or is found there. Nice try, though. Relatch 550 — 9y

Answer this question