Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to script a teleport queue?

Asked by 6 years ago

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

0
Please attempt first BlackOrange3343 2676 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

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.

0
Learn how to script then try to make it. If there are errors let us know. forbrad 2 — 6y
Ad

Answer this question