generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How to set Starter Health?

Previous Thread :: Next Thread 
XxKonArtistxX is not online. XxKonArtistxX
Joined: 28 Jun 2012
Total Posts: 74
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
Mathfreak231 is not online. Mathfreak231
Joined: 21 Jun 2010
Total Posts: 5311
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
XxKonArtistxX is not online. XxKonArtistxX
Joined: 28 Jun 2012
Total Posts: 74
23 Jul 2012 11:13 AM
Thanks :D
Report Abuse
XxKonArtistxX is not online. XxKonArtistxX
Joined: 28 Jun 2012
Total Posts: 74
23 Jul 2012 11:49 AM
It crashes my Test >>> PlaySolo client -.-
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
23 Jul 2012 11:52 AM
That should not crash it, but put a wait in there just to be safe.
Report Abuse
XxKonArtistxX is not online. XxKonArtistxX
Joined: 28 Jun 2012
Total Posts: 74
23 Jul 2012 12:00 PM
I added a wait() and no result

____________________________
Damage ...
Report Abuse
XxKonArtistxX is not online. XxKonArtistxX
Joined: 28 Jun 2012
Total Posts: 74
23 Jul 2012 12:04 PM
The script doesnt work if I add
wait()
wait(1)
wait(10)
wait(100)
Report Abuse
XxKonArtistxX is not online. XxKonArtistxX
Joined: 28 Jun 2012
Total Posts: 74
23 Jul 2012 12:32 PM
No one?
Report Abuse
Swordphin123 is not online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
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
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
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
XxKonArtistxX is not online. XxKonArtistxX
Joined: 28 Jun 2012
Total Posts: 74
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
XxKonArtistxX is not online. XxKonArtistxX
Joined: 28 Jun 2012
Total Posts: 74
23 Jul 2012 03:47 PM
Help Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image