Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

i am trying to make a teleporter that teleports everyone to their own box. Where do i start?

I have been trying to start somewhere but i just have absolutely no clue

1 answer

✓ Accepted answer

You will definitely need some boiler plate stuff like this:

-- Assuming you want players to teleport based off touching a teleporter
teleporter.Touched:Connect(function(hit) -- Something touched the teleporter?
	if hit.Parent:FindFirstChild("Humanoid") then -- Is it a player?
		local char = hit.Parent -- Gonna need the player's character
		char:MoveTo(otherTeleporter.Position) -- Tele them to the other teleporter
	end
end)

-- Or by any other means (e.g. counter reaches extent)
-- if counter == extent then >>>
for i,player in ipairs(game.Players:GetPlayers()) do
	local char = player.Character or player.CharacterAdded:Wait()
	char:MoveTo(otherTeleporter.Position)
end

However to separate them out you will need to make a table of teleporters. And then when a teleport has been performed you will remove that teleporter from the table to only allow one teleport to it.

Note: If you copy my code please make sure you press View Source to copy it right Note: If you attempt it, you can bring your errors to the discord channel for fast help!

4 comments

0

i dont want it to hit i want it to be and automatic thing when the counter hits 0 right?

0

I have edited it to represent the other way that you're looking for.

0

what do i put in "other teleporter" because i have a teleport group with lots of parts inside

0

Make a primary part

This discussion is preserved as it was. New answers, comments, and votes are closed.