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: Whats wrong here

Previous Thread :: Next Thread 
Club24Hour is not online. Club24Hour
Joined: 23 Oct 2011
Total Posts: 1795
15 Apr 2014 08:56 PM
This script is supposed to change your health and max health when you have the armor on. It makes your max health 500, but the regular health only goes to 175 then you heal

num = 500

game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child)
if child.Name == "Heavy" then
game.Players.LocalPlayer.Character.Humanoid.MaxHealth = num
game.Players.LocalPlayer.Character.Humanoid.Health = num
end end)

game.Players.LocalPlayer.Backpack.ChildRemoved:connect(function(child)
if child.Name == "Heavy" then
game.Players.LocalPlayer.Character.Humanoid.MaxHealth = game.Players.LocalPlayer.Character.Humanoid.MaxHealth - num
game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.Health - num
end end)
Report Abuse
Club24Hour is not online. Club24Hour
Joined: 23 Oct 2011
Total Posts: 1795
15 Apr 2014 08:58 PM
bump
Report Abuse
Zakkeh is not online. Zakkeh
Joined: 24 Oct 2013
Total Posts: 1133
15 Apr 2014 09:00 PM
I don't notice the problem, however are you sure the item going in is called "Heavy" and the location it enters is "Backpack", if not it may be a problem with "Heavy"'s code.

--I be chewin' teh Dino Nuggets.
Report Abuse
Club24Hour is not online. Club24Hour
Joined: 23 Oct 2011
Total Posts: 1795
15 Apr 2014 09:01 PM
Yea it all works, it makes the max health 500 but the players health is at 175
Report Abuse
Club24Hour is not online. Club24Hour
Joined: 23 Oct 2011
Total Posts: 1795
15 Apr 2014 09:03 PM
Apparently it was just a matter of having a wait statement between the health and max health.
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