How can I make a intermission script?

The script looks like this put together:

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)

Here: Screenshot by Lightshot

OnlyThirtyCharacters

1 Like
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
1 Like

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

1 Like

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.

2 Likes

Remember to make a remote event in replicated storage.

local remoteEvent = remoteeventlocationhere is underlined orange, what’s wrong?

“remoteeventlocationhere” is just a placeholder you must make your own remote event and add the instance there. Example: local remoteEvent = game.ReplicatedStorage.remoteeventname

instance? im not familiar with scripting terms.

Check this page out on remote events/functions Custom Events and Callbacks | Documentation - Roblox Creator Hub PS: You’d be using server to clients

nvm ive got it i think

OnlyThirtyCharacters

1 Like

it’s not working.

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.

May I suggest this video.

It seems like this is what you’re going for.

2 Likes

how do i script the actual timer which says 3…2…1… etc.

1 Like
local remoteEvent = game.ReplicatedStorage.IntermissionCountdown
local TextLabel = --Your countdown textlabel here

remoteEvent.OnClientEvent:Connect(function(CountdownNumber)
TextLabel.Text = tostring(CountdownNumber)
end)

I have the timer working now, how can I script it so it teleports the player?

I can’t help you with that since you have to choose the position yourself.

for _,plr in pairs (game.Players:GetPlayers()) do
plr.Character.HumanoidRootPart.Position = Vector3.new(X,Y,Z) --Choose this position
end

Alternatively you could do:
plr.Character.HumanoidRootPart.Position = partyouwantplayerstoteleportto.Position

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