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

How do you make a timed teleport?

Is there a script which can automatically teleport players from the lobby to a map and from the map back to the lobby but like, every 5 minutes or so.

1 comment

0

Try not to ask questions like "is there a script that...", because the answer is almost always "yes". The trick is to try solving the problem yourself then asking for feedback.

2 answers

Yes. Here is a quick one.

time = 60 * 5 -- 5 Mins
players = game.Players:GetChildren()
while true do
for i = 1, #players do
	wait(time) 
	players[i].Character:MoveTo(Vector3.new(pos1,pos2,pos3))
	wait(time)
	players[i].Character:MoveTo(Vector3.new(pos1,pos2,pos3))
	
end
end

local Time = 60 * 5  -- 5 Minutes
local LobbyCFrame = CFrame.new(0, 0, 0)
local MapCFrame = CFrame.new(0, 0, 0)
local InLobby = true

while wait() do
wait(Time)
if InLobby == true then
for i,v in pairs (game.Players:GetPlayers()) do
if v.Character:FindFirstChild("Torso") then
v.Character.Torso.CFrame = MapCFrame 
end
end
wait(Time)
InLobby = false
elseif InLobby == false then
for i,v in pairs (game.Players:GetPlayers()) do
if v.Character:FindFirstChild("Torso") then
v.Character.Torso.CFrame = LobbyCFrame 
end
end
wait(Time)
InLobby = true
end
end

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