Intermission For a Minigames Game

I’m trying to make a countdown that teleports the players when it hits 0 seconds but I really have no idea how to make it, I tried searching for tutorials on search engines but I couldn’t find what I’m looking for.

Can anyone help me do that, I don’t need full scripts I just need a guide on how to do that. Thank you!

3 Likes

Do you want the countdown to be local like on a gui? Or just on the server?

1 Like

Example Code :slight_smile:

local players = game:GetService("Players")
local break_time =  5 -- Break Time You Want
local game_spawn = workspace:FindFirstChild("Part Name") -- Part that Player Teleport to

local function Count() -- Make New Function
if game_spawn then -- If there is a Spawn Part in Worksapce
for players, all_players in pairs(players:GetPlayers()) do -- Get All Players
local gui = all_players.PlayerGui:FindFirstChild("Gui Name") -- Find Your Gui in all Player's Gui
local text_label = gui:FindFirstChild("TextLabel Name") -- Find Your Text Label in Gui
if gui and text_label then -- If there is a Gui in Player Gui and TextLabel in Gui
gui.Enabled = true -- Set Gui Enabled to True
text_label.Text = "" -- Set Text Label Text to Nothing
for i = break_time , 0, -1 do -- repeat below code until break_time goes to 0
     task.wait(1)
    text_label.Text = "Game Start After "..i.." Seconds" -- Change Text_Label Text
end
--- After Finishing Loop
task.wait(1) -- Wait 1 Seconds
gui.Enabled = false -- Set Gui Enabled to False
all_players.Character:PivotTo(game_spawn.CFrame) -- Teleport All Players to SpawnPart You Selected(3 line)
end
end
end
end

game.Players.PlayerAdded:Connect(Count) -- Start Count Function

Do you want players to teleport after finishing the loop?

1 Like

Cause you can loop through players again like

For _, player in pairs(game.Players:GetChildren()) do
   Local char = player.character
   If player.char then
      If char:FindFirstChild(”HumanoidRootPart”) then
         Player.HumanoidRootPart.CFrame = Part.CFrame
      end
   end
end
1 Like

Thank you so much for explaining :heart: @Kanglim12

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.