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: Scripting Problems

Previous Thread :: Next Thread 
XxDarkMiragexX is not online. XxDarkMiragexX
Joined: 26 Mar 2013
Total Posts: 160
12 Jun 2013 12:40 AM
In my RPG, there's this custom Health bar, and when your health is low, I want it to turn from green to red. And when it restores, I want it to change back. I wrote this script and it isn't working? Help?



P = script.Parent.Parent.Parent.Parent.Character.Humanoid

while true do

if P.Health > 0 and P.Health < (P.MaxHealth / 4) then
script.Front.BackgroundColor3 = Color3.new (184, 18, 18)
end
if P.Health > (P.MaxHealth / 4) or P.Health < 1 then
script.Front.BackgroundColor3 = Color3.new (0, 103, 0)
end
wait()
end

Report Abuse
spearman2 is not online. spearman2
Joined: 28 May 2010
Total Posts: 2938
12 Jun 2013 05:09 AM
Put an elseif

P = script.Parent.Parent.Parent.Parent.Character.Humanoid

while true do

if P.Health > 0 and P.Health < (P.MaxHealth / 4) then
script.Front.BackgroundColor3 = Color3.new (184, 18, 18)
elseif P.Health > (P.MaxHealth / 4) or P.Health < 1 then
script.Front.BackgroundColor3 = Color3.new (0, 103, 0)
end
wait()
end

Report Abuse
ForceSky is not online. ForceSky
Joined: 30 Jul 2012
Total Posts: 2379
12 Jun 2013 06:17 AM
You're missing an end.
Report Abuse
funnymouse7 is not online. funnymouse7
Joined: 17 Mar 2011
Total Posts: 1741
12 Jun 2013 06:20 AM
I dont think Health can do under 0 because it stops at zero I think so try instead of a > an =>
Report Abuse
XxDarkMiragexX is not online. XxDarkMiragexX
Joined: 26 Mar 2013
Total Posts: 160
12 Jun 2013 03:04 PM
Nope. None of these works. I'll try and look into it more.
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