I recently wanted to make a Intermission/lobby game but it wouldn’t work, I would appreciate feedback or help. Thanks!
here are the scripts.
the LocalScript
local Status = game.ReplicatedStorage.Status
local TimerDisplay = script.Parent.TimerDisplay
Status.Changed:Connect(function()
TimerDisplay.Text = Status.Value
end)
This script is inside a intermission GUI inside StarterGUI
this is the script inside ServerScriptService
-- Round Variables
local roundLength = 5
local intermissionLength = 10
local inRound = game.ReplicatedStorage.inRound
local Status = game.ReplicatedStorage.Status
local LobbySpawn = game.Workspace.LobbySpawn
local GameAreaSpawn = game.Workspace.GameAreaSpawn
inRound.Changed:Connect(function()
wait(1)
if inRound.Value == true then
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Chracacter
char.HumanoidRootPart.CFrame = GameAreaSpawn.CFrame
end
else
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Chracacter
char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
end
end
end)
local function roundTimer ()
while wait() do
for i = intermissionLength, 1, -1 do
inRound.Value = false
wait(1)
Status.Value = "Intermission: ".. i .." seconds left!"
end
for i = roundLength, 1, -1 do
inRound.Value = true
wait(1)
Status.Value = "Game: ".. i .." seconds left!"
end
end
end
spawn(roundTimer)
there are also two Values
a string value called Status
and a Bool value called inRound
they are both in ReplicatedStorage.