|
| 23 Jul 2012 11:09 AM |
| I am wanting to build a script but I need to set MaxHealth first. How would I do this? |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 11:12 AM |
game.Players.PlayerAdded:connect(function(NewPlayer) NewPlayer.CharacterAdded:connect(function(char) char.Humanoid.MaxHealth = 9999 --replace 9999 with what you want it to be end) end)
Somethin' like that.
~This sig is false~ |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jul 2012 11:49 AM |
| It crashes my Test >>> PlaySolo client -.- |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 11:52 AM |
| That should not crash it, but put a wait in there just to be safe. |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 12:00 PM |
I added a wait() and no result
____________________________ Damage ... |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 12:04 PM |
The script doesnt work if I add wait() wait(1) wait(10) wait(100)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jul 2012 12:49 PM |
Put this script inside StarterGui:
~~~~~~~
repeat wait() until script.Parent.Parent.Character
script.Parent.Parent.Character.Humanoid.MaxHealth = 350 script.Parent.Parent.Character.Humanoid.Health = script.Parent.Parent.Character.Humanoid.MaxHealth |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 01:17 PM |
Or more efficiently...
setMaxHealthTo = 999 Game.Players.PlayerAdded:connect(function(Player) wait() Player.CharacterAdded:connect(function(Character) repeat wait() until Character:findFirstChild("Humanoid") Character.Humanoid.MaxHealth = setMaxHealthTo Character.Humanoid.Health = Character.Humanoid.MaxHealth end) Character.Humanoid.MaxHealth = setMaxHealthTo Character.Humanoid.Health = Character.Humanoid.MaxHealth end) |
|
|
| Report Abuse |
|
|
|
| 23 Jul 2012 02:13 PM |
epic, that doesnt work when i set it to 1000
At first, it doesnt change my health when I enter and then when I respawn ... The client crashes. |
|
|
| Report Abuse |
|
|
| |
|