How to make a teleportation script as shown here

Hello! I’m back, haven’t been active here recently… :thinking:

Anyways as shown in this GIF:

https://gyazo.com/573c3ddd0d2572395be237c989227ae7

ignore my avatar my friends and I were doing a little skit.

The game can be found here: Field Trip - Roblox

Once every seat is taken, the bus disappears, everyone gets teleported, then it respawns. How would I do this? I’m guessing for the teleportation script, the circle is a teleportation block, and there is a teleport block on the seats. Thats how you do it, right? Or is there a better way? I’m mostly need help on the second part, when the bus is full, it disappears, everyone gets teleported and the bus respawns. If anyone knows how I should start doing this, please let me know!

Thanks for reading! :smile:

This is done using a touch or distance to the circle. then it just moves the player’s character most likely with Character:SetPrimaryPartCFrame() then anchor the character’s humanoidrootpart or by using Seats and using the Sit(humanoid)
after that they are added to a table for teleport

local Bus1 = {}
table.insert(Bus1,Player)

Then in a while loop he maybe checking if the number of players is max or over a certain number

while true do
	
		if #Bus1 > 10 do  -- 10 riders or more
          -- set the bus invisble by setting all its Decendant Baseparts to Transparency = 1
			-- call teleport function which goes through table and teleports them to another game server it has created
		end
	end
	wait(5)
end

many ways you could do this

3 Likes

Either the bus is teleported itself or its transparency is at 1 and CanCollide is false. You can teleport all the people on the bus by using for loops, checking each if each seat has an occupant. If it does, it identifies the person and teleports their HumanoidRootPart. As Nyonic has said, there are many ways to do this.

1 Like

As far as I can see, the bus is being removed and the players are being sent to another place via teleport service.

Another way to simulate the bus being removed is to set the Transparency to 1 of all of the parts by using a for i,v in pairs loop, and setting them all to CanCollide = false.

To make make the bus reappear, you’d clone the same model and move it to a location via PrimaryPart’s CFrame or :MoveTo(), if you’re using the 2nd method you want to apply the opposite changes you made.

Edit: I accidentally replied to DARKM’s post

1 Like