#Having trouble scripting a round system

1 messages · Page 1 of 1 (latest)

coarse hawk
#

My game has an assassin like round system to it. Intermession > Map Selection >Game that ends with one player left. Currently, in replicated storage I have an intvalue that keeps track of the players. A stringvalue that keeps track of what part of the game it is (INtermession, map selection, or inround). I also have a text label under game.StarrterGui.GameStatusGUI.Frame.GameStatusText

I will have my code posted.

#
local GameStatus = game.ReplicatedStorage.GameStatus

GameStatus:GetPropertyChangedSignal("Value"):Connect(function()
    if GameStatus.Value == "Intermission" then
        
    end
end)

GameStatus:GetPropertyChangedSignal("Value"):Connect(function()
    if GameStatus.Value == "MapSelection" then

    end
end)

GameStatus:GetPropertyChangedSignal("Value"):Connect(function()
    if GameStatus.Value == "Game" then
        local PlayersInRound = game.ReplicatedStorage.PlayersCount
        while true do
            local Players = game:GetService("Players")
            for _, player in pairs(Players:GetPlayers()) do
                local gui = player:FindFirstChild("PlayerGui")
                if gui then
                    local targetGUI = gui:FindFirstChild("GameStatusGUI")
                    targetGUI.Frame.GameStatusText.Text = "GameStarted"
                end
            end
            --if PlayersInRound.Value <= 1 then
            --    GameStatus.Value = "Intermission"
            
            --end
            wait(0.1)
        end
    end
end)