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: Simple script gone wrong!

Previous Thread :: Next Thread 
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
17 Mar 2012 07:58 PM
I made this simple script where when a Zombie takes damage it shows the damage in the name for example
Zombie {100/100}
Gun does 40 damage
Zombie {60/100}

But
A) It doesn't even work
B) When I try solo mode it crashes before it begens
C) When I click play in studio it crashes
D) When in a server few other scripts work (Guns, and GUIs)

while true do
script.Parent.Name = "Zombie {" .. script.Parent.Humanoid.Health .. "/" .. script.Parent.Humanoid.MaxHealth .. "}"
end

I think the problem is the while true do but I dont know any other way.
Im also not the best scripter infact I usually just take free model scripts and edit them.
Report Abuse
SecretsOfTheKing is not online. SecretsOfTheKing
Joined: 11 Jul 2009
Total Posts: 44
17 Mar 2012 08:05 PM
script.Parent.Name = "Zombie {" .. script.Parent.Humanoid.Health .. "/" .. script.Parent.Humanoid.MaxHealth .. "}"
script.Parent.Humanoid.Changed:connect(function(Prop)
if Prop == "Health" then
script.Parent.Name = "Zombie {" .. script.Parent.Humanoid.Health .. "/" .. script.Parent.Humanoid.MaxHealth .. "}"
end
end)


You forgot to put a wait, that makes it loop infinite times in zero seconds

Try this anyways, since its not a loop its a lot more efficient.
Report Abuse
imcoolfire8 is not online. imcoolfire8
Joined: 23 Nov 2009
Total Posts: 3008
17 Mar 2012 08:53 PM
Thank you so much!
I didn't even know that was a function!
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