|
| 28 Jul 2016 12:06 PM |
while wait() do if script.Parent["Left Arm"] == nil then script.Parent.Humanoid.Health = 0 end end
It's suppose to be if there is no left arm, then health = 0 |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2016 12:09 PM |
The more loops you have working in a game, the laggier it will be. Try creating a function that fires when a child is removed from the parent.
Model = script.Parent
Model.ChildRemoved:connect(function() if script.Parent:FindFirstChild('Left Arm') ~= true then script.Parent.Humanoid.Health = 0 end end) |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2016 12:29 PM |
Thanks ^,
Also I have a lot of loops in the game and there really stupid, should I consider changing them to Changed:Functions? |
|
|
| Report Abuse |
|
|
|
| 28 Jul 2016 12:30 PM |
| I usually use object:FindFirstChild("asdf") ~= nil but I guess that works too! |
|
|
| Report Abuse |
|
|