My round system isnt working properly!

After the last wait you reset the inRound value to the value it was before.

where??? in my whole code the last one or what?? if so show me how the code should look like

I’m not showing you how the code should look like.
I did that yesterday for you and the point didn’t come across. You even forgot to mark that topic as solved.
I’m telling you how to do it correctly. If needed reread what i said and you’ll understand eventually :+1:

sorry but for me its really hard to understand your text thats why im asking how it should look right after i put at to solved but it isnt solved btw

All good. Just try putting the inRound value back to normal after the last wait. Then it might work

Ok would it be easier if all the players are added to a table for the lobby and when a round starts it clears. Then all you need to do it add players to the lobby table using the characterremoving function and the player who is not in the table is the winner

which last wait? in the whole code or what? thats why i dont understand

Yes, the last wait you provided in here.

may you reedit your message and show which?? it might help me with doing it when i see where it is!

<e that could be possible but idont know how to do that. also if you write the lines should i replace it with the line in here?
image

By the way what do you mean by setting inround value back to normal, what will that??? Sorry I just don’t get it

1 Like

Yes it should work there. You could also follow a tutorial for this, something like AlvinBlox’s videos

please look atout for large and lower case because these can ruin the script!

alr bet thank you very much i apprecieate your help

what is the video called by AlvinBlox??

What i mean by that is this:

local intermission = 10
local roundLength = 120

local inRound = game.ReplicatedStorage.InRound
local status = game.ReplicatedStorage.Status
local TC = game.ReplicatedStorage.TC

local function SetStatusMessage(message)
	status.Value = message
end
local function SetTextMessage(message)
	TC.Value = message
end


local function TeleportToSpawnPoint(spawnPoint)
	if spawnPoint == nil then return end
	for _, v in pairs(game:GetService("Players"):GetPlayers()) do
		v.Character.HumanoidRootPart.CFrame = spawnPoint
	end
end

inRound.Changed:Connect(function()
	if inRound.Value == true then
		SetStatusMessage("In Round")
		TeleportToSpawnPoint(game.Workspace.DropGame.RoundSpawn.CFrame)
	else
		SetStatusMessage("In Lobby")
		TeleportToSpawnPoint(game.Workspace.Lobby.LobbySpawn.CFrame)
	end
end)


local function round()    
    while true do
        local requiredPlayers = 2

        repeat
            wait(1)
            SetStatusMessage("Waiting for players...")
        until #game.Players:GetPlayers() >= requiredPlayers

        inRound.Value = false

        for i = intermission, 0, -1 do
            SetStatusMessage("Game will start in "..i.." seconds")
            wait(1)
        end

        inRound.Value = true

        local roundEnded = false
        local winningPlayer = nil

        for i = roundLength, 0, -1 do
            SetStatusMessage("Game will end in "..i.." seconds")
            local playing = {}

            for _, plr in pairs(game.Players:GetPlayers()) do
                if not plr.Team then
                    table.insert(playing, plr)
                end
            end

            if #playing == 0 then
                SetStatusMessage("Everyone Has Died")
                roundEnded = true 
                break
            end

            if #playing == 1 then
                local winner = playing[1]
                SetStatusMessage(winner.Name.." Has Won The Game!")
                winningPlayer = winner
                roundEnded = true
                break
            end

            wait(1)
        end

        if not roundEnded then
			SetStatusMessage("The round has ended")
        end

        if winningPlayer then
			
            local randomCoins = math.random(20, 100)
            winningPlayer.leaderstats.Wins.Value += 1
            if winningPlayer.MembershipType == Enum.MembershipType.Premium then
                randomCoins = randomCoins * 2
            end
			winningPlayer.leaderstats.Coins.Value += randomCoins
			
			TC.Archivable = true
			if winningPlayer.MembershipType == Enum.MembershipType.Premium then
				SetTextMessage("You have gotten "..randomCoins.."! (Double Coins Premium)")
			else
				SetTextMessage("You have gotten "..randomCoins.."!")
			end
			wait(4)
			TC.Archivable = false
        end

        wait(3)
		inRound.Value = false -- This right here
    end
end

spawn(round)

it still marks (round) red its wmth abt the one script roblox generated for me

is there any solution to get it fixed??

I’ve cam up with a solution but it still doesnt work so smebody please help me!
image

It still dont work and i tried to fix it! how can i fix this? it also can be a touch thing so i can do its location

	local playing = {}
			local lobby = {} -- Create empty tables to store playing and lobby players

			-- Function to update player status
			local function UpdatePlayerStatus(player, OnRoundValue, checkingValue)
				local OnRound = Instance.new('BoolValue', player)
				OnRound.Name = 'OnRound'
				OnRound.Value = OnRoundValue
				local checking = Instance.new('BoolValue', player)
				checking.Name = 'Checking'
				checking.Value = checkingValue
			end

			-- Loop through all players in the game
			for _, plr in pairs(game.Players:GetPlayers()) do
				-- Check if the player has a team (is playing)
				if not plr.Team then
					-- Player is actively playing
					table.insert(playing, plr)
					UpdatePlayerStatus(plr, true, true) -- Set inRound and Checking values
				else
					-- Player is in the lobby or has died
					table.insert(lobby, plr)
					UpdatePlayerStatus(plr, false, false) -- Set inRound and Checking values
				end
			end