I have simple code that removes a boat if you board and exit:
script.Parent.ChildRemoved: connect (function () - this is a trigger which is essentialy checking to see if you jump from the seat wait (10) —this line tells the code to wait 10 seconds script.Parent.Parent: remove () —this line deletes the car end)
But I would like the script to work immediately after the spawn of the boat (that is, immediately after the spawn of the boat, it is deleted after 10 seconds). Also, if you catch a boat, the timer (for 10 seconds in the script) stops, deletion does not occur, and when leaving the boat the timer starts from the beginning.
Please help, I don’t understand the code...