Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

how to make minigames during rounds?

Asked by 1 year ago

I watched a tutorial on how to make intermission and rounds that have a timer and tp players to lobby/game when the timer is over. My game is a game where once you spawn into the game area, disasters like volcanos and acid rain will happen. but with this script I cant figure out how to make those events start when players tp to the game area. My script:

local roundLength = 125
local intermissionLength = 35
local LobbySpawn = game.Workspace.LobbySpawn
local PlateSpawn = game.Workspace.PlateSpawn

local Status = game.ReplicatedStorage.Status
local InRound = game.ReplicatedStorage.InRound

InRound.Changed:Connect(function()
    wait (1)
    if InRound.Value == true then
        for _, players in pairs(game.Players:GetChildren()) do
            local char = players.Character
            char.HumanoidRootPart.CFrame = PlateSpawn.CFrame
        end
    else
        for _, players in pairs(game.Players:GetChildren()) do
            local char = players.Character
            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 ..""
        end


        for i = roundLength, 1, -1 do
            InRound.Value = true
            wait (1)
            Status.Value = "Chaos: ".. i ..""
        end


    end
end
    spawn(roundTimer) 

0
(I want 11 events to start, so I want a random one out of 11 to spawn) Professor_kittykat -2 — 1y
0
I just realized s this is super un clear, in clearer words, the script I posted works. but, I want to make a script when InRound.Value == True, then pick a random number 1-11. But where would I put that in the script and what would be the short script line to pick a number 1-11, and what would be the script like, “if number = 1, blah blah” Professor_kittykat -2 — 1y

Answer this question