I have this removal script, that checks if someones sat in the seat, if not it removes it, but if it does, and then the player exits, it removes after 30 secs. The last bit (marked below) works on its own with the function, but the bit at the top dosen't work. I am unsure whether this is a problem with the ends or with the script itself.
Seat = script.Parent
Time = 30
LastSit = 0
function Seated(Added)
wait(Time)
if not Added:IsA("Weld") then
Seat.Parent:Remove()
else -- The rest after this works on its own
local ThisSit = time()
LastSit = ThisSit
while Added.Parent do
Added.AncestryChanged:wait()
end
wait(Time)
if LastSit == ThisSit then
Seat.Parent:Remove()
end
end
end
end
Seat.ChildAdded:connect(Seated)
This output came up
Workspace.Bus15.VehicleSeat.Script:22: 'eof' expected near 'end'
Any help would be much appreciated, as this is VERY important in my game.
MasterDaniel |