I've tried but keep failing :( I want it so when people jump out of my coaster they get teleported next to the station so they can't go on the track Does anyone have any ideas?
The solution to your answer is pretty simple, hope this helped. ^w^
Code below with explanation:
local Players = game:GetService("Players") local seat = script.Parent --This means the script has to be in the seat. local currentPlayer = nil seat:GetPropertyChangedSignal("Occupant"):Connect(function() local humanoid = seat.Occupant if humanoid then --if a player is sitting, then local character = humanoid.Parent local player = Players:GetPlayerFromCharacter(character) if player then print(player.Name.." has sat down") currentPlayer = player --sets the player to currentplayer so that we can detect when they stand up return end end if currentPlayer then --if a player isn't sitting, then wait(0.5) --has to have a bit of delay otherwise the character seems to get flinged currentPlayer.Character:MoveTo(Vector3.new(20.46, 0.5, -26.17)) --after the wait is over, move the character to the given position. Obviously you can change this to whatever position you need. print(currentPlayer.Name.." has got up") currentPlayer = nil --sets it to nil so that another player can sit on it end end)
If this helped make sure to accept my answer. :3