Solttu
|
  |
| Joined: 05 Jan 2010 |
| Total Posts: 86 |
|
|
| 03 Mar 2017 10:25 AM |
Can you help me fix this script?
local B = script.Parent:FindFirstChild("Base")
while true do if B == nil then wait() script.Parent:Destroy()
end
The point of the script would be to destroy the whole model after it detects that the base inside the model no longer exists.
Thanks in advance! |
|
|
| Report Abuse |
|
|
| |
|
Solttu
|
  |
| Joined: 05 Jan 2010 |
| Total Posts: 86 |
|
| |
|
|
| 03 Mar 2017 10:41 AM |
script.Parent.ChildRemoved:connect(function(object)
if (object.Name == "Base") then script.Parent:Destroy() end
end) |
|
|
| Report Abuse |
|
|
Solttu
|
  |
| Joined: 05 Jan 2010 |
| Total Posts: 86 |
|
| |
|