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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Health Script Logic Error

Previous Thread :: Next Thread 
mageragegamer is not online. mageragegamer
Joined: 19 Aug 2012
Total Posts: 3067
30 Jan 2013 08:30 PM
I have a Game Pass that increases max health to 200, and the script works. However, when you spawn, you have 100 health, and pass owners must let their health regen to get to 200. How do I make it so that pass owners spawn with 200 health?

Here is the current script:

GamePassId = ID_NUMBER
Game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
if Game:GetService("BadgeService"):UserHasBadge(player.userId, GamePassId) then
repeat wait() until character
character.Humanoid.MaxHealth = 200
end
end)
end)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
30 Jan 2013 08:31 PM


    character.Humanoid.MaxHealth = 200
    character.Humanoid.Health = 200

¤ ¤ † K M <( •д• )> X D † ¤ ¤
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
30 Jan 2013 09:27 PM
character.Humanoid.MaxHealth = 200
character.Humanoid.Health = character.Humanoid.MaxHealth

--More efficient if he ever needs to edit it. :P

~Apply to join my primary group if you can script~
Report Abuse
mageragegamer is not online. mageragegamer
Joined: 19 Aug 2012
Total Posts: 3067
31 Jan 2013 05:07 PM
But if I do that, won't it repeatedly make the person's health 200?
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
31 Jan 2013 05:14 PM
It will give the person with the asset provided 200 health every time the person respawns.

~ṡсɾïρτïṉģ hεlρεɾṡ ۩ lυαlεαɾṉεɾṡ ④ øƒвќṃṿј~ ღ ▂▃▅▆█ρεώḋïερïε☄сυτïερïε█▆▅▃▂ღ 【▬】
Report Abuse
ArbiterOfDeath is not online. ArbiterOfDeath
Joined: 20 Jun 2011
Total Posts: 1458
31 Jan 2013 05:15 PM
No. Only every time they spawn.
Report Abuse
mageragegamer is not online. mageragegamer
Joined: 19 Aug 2012
Total Posts: 3067
31 Jan 2013 05:15 PM
Thanks.
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