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

How to teleport a group of player standing on a platform using countdown timer?

I've learned you have to use reserveserver. What I really want to know is after a countdown of for an example 30 seconds, is to teleport whoever is standing on a platform to a private server. After teleporting, for the countdown to restart. (BASICALLY the script going into a loop)

[Have to be a minimum of 2 players standing on the platform]

1 answer

✓ Accepted answer

like this

local platform = workspace.platform --platform they stand on;
local TeleportService = game:GetService("TeleportService");
local MINIMUM_PLAYERS = 2


while wait() do
	touching = platform:GetTouchingParts();
	local players = {};

	for _, part in pairs(touching) do
		local player = game.Players:GetPlayerFromCharacter(part.Parent) 
		if(player)then
			players[#players + 1] = player
		end
		wait();
	end

	if(#players >= MINIMUM_PLAYERS) then
		for i = 10, -1, 1 do
			print("Teleporting in ", i)
			wait(1)
		end

		TeleportService :TeleportToPrivateServer(place_id, server_code_from_ReserveServer(), players)
	end
end

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