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

How to script a teleport queue?

For example it will wait until the game has 4 players, then it will teleport to a place.

1 comment

0

Please attempt first

1 answer

I really don't get why people come on and expect a script for them.

I will provide you a script explaining what each part does since after a while of thought I have decided that even something like this can be helpful.

local player_count = 0

game.Players.PlayerAdded:Connect(function(plr) -- fires when a player joins your game
	player_count = player_count + 1 -- increases player_count
	if player_count == 4 then -- if the player count is 4 after adding that player
		-- do the teleporting, this you will have to find out how by googling
	end
end)

game.Players.PlayerRemoving:Connect(function() -- runs when player leaves 
	player_count = player_count - 1 -- takes away a player from the count
end)

Now I have provided you the base of the solution to your problem.

What you want to do is improve this script and add a teleporting system (TeleportService)

You also may want to instead of using the variable player_count change it and check the Players service.

Hopefully, you actually read my comments in the script and learn. Note that copy and pasting this expecting it to work will NOT work.

Hope you learn and best of luck to you.

1 comment

0

Learn how to script then try to make it. If there are errors let us know.

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