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

How do i make a minecart despawn after a while?

Asked by 3 years ago

So i have a minecart game and i let some people test it out, after a while they were spamming the minecarts and u couldn't go further because all the minecarts were blocking the path, so i was thinking of maybe adding a script that if no one is sitting in the minecart then after 10 seconds it despawns?

1 answer

Log in to vote
0
Answered by 3 years ago

hope this can help : local seat = game.Workspace.Seat

while true do wait(10) if seat.Occupant == nil then seat:Destroy() end end

Ad

Answer this question