Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Why doesn't this script work?

Asked by 10 years ago

So I wanted to make a bus disappear 15 seconds after the driver jumps out of the VehicleSeat, unless someone gets back in before 15 seconds. Here is my script:

script.Parent.ChildRemoved:connect(function()

local a = script.Parent.Parent.VehicleSeat.ChildAdded:connect(function()

for i=1,60 do

wait(i/4)

if a then return

elseif not a then script.Parent.Parent:Destroy()

end

end

end)

end)

Could anybody please explain or write a script that does this for me?

-BunnySour

Answer this question