|
| 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 |
|
|
|
| 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 |
|
|
|
| 17 Mar 2012 08:53 PM |
Thank you so much! I didn't even know that was a function! |
|
|
| Report Abuse |
|
|