local CountdownTime = 10 --Intermission time
local remoteEvent = remoteeventlocationhere
repeat
CountdownTime -= 1
remoteEvent:FireAllClients(CountDownTime)
until CountdownTime == 0
for _,plr in pairs (game.Players:GetPlayers()) do
plr.Character.HumanoidRootPart.Position = Vector3.new() --Choose this position
end
Put the script in ServerScriptService, for the gui make a localscript in StarterGui and make it this:
local remoteEvent = remoteeventlocationhere
remoteEvent.OnClientEvent:Connect(function(CountdownNumber)
--Make CountdownNumber as text in a textlabel
end)
function update(ttime)
game.ReplicatedStorage.updateTime:FireAllClients(ttime - os.time())
end
local ntime = 60 -- in seconds
local ttime = os.time() + ntime
repeat wait() update(ttime) until os.time() >= ttime
for i,v in pairs(game.Players:GetPlayers()) do
local ch = v.Character
repeat wait() until ch ~= nil
local root = ch:FindFirstChild("HumanoidRootPart")
root.Position = Vector3.new(0,0,0)-- position to teleport to
end
The way I do it is to create an infinite loop that invokes 3 functions, intermission(), gamemode() and reset() intermission()
all it does is doing the countdown and waiting for the minimum players gamemode()
selects a gamemode/minigame and plays it reset()
resets the map to start a new round
and for the timer I just put a string value in the workspace and name whatever I want to display messages like “Intermission: 30” or “Round has ended!” by just changing it’s value, and then reading it on the client
If you want to make multiple intermission type scripts and not only a single one, use this module and then put it in serverstorage. Here’s what you do.
Module
local IntermissionModule = {}
function IntermissionModule.Set(num1, num2, inc, pre)
for i = num1, num2, -inc do
wait(1)
return pre .. ": ".. i
end
end
return IntermissionModule
Script
local ServerStorage = game:GetService("ServerStorage")
local IntermissionModule = require(SeverStorage:WaitForChild("IntermissionModule")
local IntermissionTimeFrame = Intermission.set(30, 1, 1, "Intermission")
while true do
wait(1)
print(IntermissionTimeFrame)
end
EDIT: please correct me if I’m wrong, haven’t been playing with modules in a while
If you would like a more advanced version of the module, I can share it to you.
“remoteeventlocationhere” is just a placeholder you must make your own remote event and add the instance there. Example: local remoteEvent = game.ReplicatedStorage.remoteeventname
That script right now does nothing as the part of the gui and selecting a position to teleport is left for you to code. You could add a print() somewhere in the script so you can see it works.
local IntermissionTime = 10
for i = IntermissionTime,0-1 do
wait(1)
-- IF U HAVE A TEXT SET THE TEXT HERE EXAMPLE: TextLabel.Text = "Intermission: "..i
end
-- This part will run after the countdown is done