|
| 07 Oct 2016 01:55 PM |
There's a value in my model called "health", which goes down when blocks within the model get shot. I need a script to remove its parent after it goes below 0.
I appriciate any help :I |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2016 02:35 PM |
if health <= 0 destroy parent |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2016 03:23 PM |
| ################################################################################################################# |
|
|
| Report Abuse |
|
|
vexieh
|
  |
| Joined: 22 Oct 2009 |
| Total Posts: 3468 |
|
|
| 07 Oct 2016 03:27 PM |
if(script.Parent.Health.Value <= 0)then script.Parent:Destroy() --or script.Parent:remove() end
|
|
|
| Report Abuse |
|
|
Sarcasmed
|
  |
| Joined: 17 May 2013 |
| Total Posts: 15201 |
|
|
| 07 Oct 2016 03:47 PM |
| ############################################################ |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2016 04:04 PM |
health.Changed:connect(function() -- not sure if this will work or you have to do .Value if health.Value < 0 then script.Parent:Remove() -- Could use :Destroy() but you said remove so.. end end) |
|
|
| Report Abuse |
|
|