Is there a better way to make players get teleported between different seats? Because I’ve tried different methods and still end up with the same problems. Basically the player gets jumped from the seat but sometimes doesn’t actually get teleported at all. Does anybody know a good way to make players get teleported between seats without any problems? Thanks.
With a bit of experimenting, I came up with a solution:
local seats: {[number]: Seat} = game:GetService("Workspace"):WaitForChild("Seats"):GetChildren()
for i, seat: Seat in ipairs(seats) do
local nextSeat = seats[i % #seats + 1]
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
local occupant: Humanoid? = seat.Occupant
if not occupant then return end
task.wait(3)
if seat:FindFirstChild("SeatWeld") then
seat.SeatWeld:Destroy()
end
occupant.StateChanged:Once(function(oldState)
if oldState ~= Enum.HumanoidStateType.Seated then return end
nextSeat:Sit(occupant)
end)
end)
end
This server-sided script loops through all seats in a “Seats” folder in workspace and makes the occupant sit in the next seat in the folder after 3 seconds of sitting.