As you see in the title, I am working on a minigame system, I already made the round system (countdowns before rounds start, with guis etc) and heres the script, now im wondering, how do i add minigames to the script? I dont know where to start and I want it to be looped, and randomised. Heres the script:
local roundLength = 120
local intermissionLength = 20
local InRound = game.ReplicatedStorage.InRound
local Status = game.ReplicatedStorage.Status
local LobbySpawn = game.Workspace.LobbySpawn
local GameAreaSpawn = game.Workspace.GameAreaSpawn
InRound.Changed:Connect(function()
if InRound.Value == true then
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = GameAreaSpawn.CFrame
end
else
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
end
end
end)
local function roundTimer ()
while wait() do
for i = intermissionLength, 0, -1 do
InRound.Value = false
wait (1)
Status.Value = "Game starts in ".. i .." Seconds!"
end
for i = roundLength, 0, -1 do
InRound.Value = true
wait(1)
Status.Value = "Game ends in ".. i .." seconds!"
end
end
end
spawn(roundTimer)
Script is made in ServerScriptService
. Please help, my game has to be done in a few days.