seat = script.Parent
s = script
function onChildAdded(child)
if child.Name == "SeatWeld" then
local human = child.part1.Parent:findFirstChild("Humanoid")
if (human ~= nil) then
print("ln")
end
end
end
function onChildRemoved(child)
if (child.Name == "SeatWeld") then
local human = child.part1.Parent:findFirstChild("Humanoid")
if (human ~= nil) then
print("Out")
wait(20)
script.Parent.Parent:Destroy()
end
end
end
script.Parent.ChildAdded:connect(onChildAdded)
script.Parent.ChildRemoved:connect(onChildRemoved)
Ok, thanks for reading and hopefully answering! So anyways, when a player gets into a car and gets out, the car will delete it self with his code:
if (human ~= nil) then
print("Human OUT")
script.Parent.Parent:Destroy() -- this one
end
but im trying to use a ultimate driving type car spawner, but of course people sometimes dont go into the cars So how would i make a car delete itself within 20 seconds if nobody goes into it? Thanks!
