Function Mysteriously Called twice

its repidly firing the intermission event or smth else, the only entrypoint for the vote system is “VOTE:Fire”
which is called in the intermission() function
firing it twice within 2 miliseconds
for a reason im trying to figure out

here the script:

function ProcessPlayerNumbers(PlayersInBattleFolder)
	script.EVENTS.PLAYER_DISPLAY:Fire(PlayersInBattleFolder)

	local totalPlayers = #game.Players:GetChildren()

	if PlayersInBattleFolder == 0 and totalPlayers > 1 then
		script.EVENTS.WAITING_FOR_PLAYERS:Fire(false)
		-- Handle the case when there are 0 players in the battle folder
		Intermission(12)
	elseif PlayersInBattleFolder == 1 and totalPlayers > 1 then
		script.EVENTS.WAITING_FOR_PLAYERS:Fire(false)

		local People = script.PLAYER_FOLDER.Value.IN_BATTLE:GetChildren()
		local Winner = People[1]
		if Winner then
			local WinnerPlayer = game.Players:GetPlayerFromCharacter(Winner)
			AnnounceWinner(WinnerPlayer.Name)
			script.EVENTS.LEADERSTATS_CHANGE:Fire(WinnerPlayer,"KILLS",1)
		end
		Intermission(script.INTERMISSION_TIME.Value)

	elseif PlayersInBattleFolder == 2 and not Standoff then
		Standoff = true
		script.EVENTS.STANDOFF:Fire()
		script.EVENTS.WAITING_FOR_PLAYERS:Fire(false)
	elseif PlayersInBattleFolder == 0 and totalPlayers == 1 then
		script.EVENTS.WAITING_FOR_PLAYERS:Fire(true)
	end
end

check the output now

local debounce = false

function ProcessPlayerNumbers(PlayersInBattleFolder)
    print("ProcessPlayerNumbers called with PlayersInBattleFolder:", PlayersInBattleFolder)

    script.EVENTS.PLAYER_DISPLAY:Fire(PlayersInBattleFolder)

    local totalPlayers = #game.Players:GetChildren()

    if PlayersInBattleFolder == 0 and totalPlayers > 1 then
        if not debounce then
            debounce = true
            script.EVENTS.WAITING_FOR_PLAYERS:Fire(false)
            -- Handle the case when there are 0 players in the battle folder
            Intermission(12)
            wait(1) -- Cooldown period
            debounce = false
        end
    elseif PlayersInBattleFolder == 1 and totalPlayers > 1 then
        if not debounce then
            debounce = true
            script.EVENTS.WAITING_FOR_PLAYERS:Fire(false)

            local People = script.PLAYER_FOLDER.Value.IN_BATTLE:GetChildren()
            local Winner = People[1]
            if Winner then
                local WinnerPlayer = game.Players:GetPlayerFromCharacter(Winner)
                AnnounceWinner(WinnerPlayer.Name)
                script.EVENTS.LEADERSTATS_CHANGE:Fire(WinnerPlayer, "KILLS", 1)
            end
            Intermission(script.INTERMISSION_TIME.Value)
            wait(1) -- Cooldown period
            debounce = false
        end
    elseif PlayersInBattleFolder == 2 and not Standoff then
        Standoff = true
        script.EVENTS.STANDOFF:Fire()
        script.EVENTS.WAITING_FOR_PLAYERS:Fire(false)
    elseif PlayersInBattleFolder == 0 and totalPlayers == 1 then
        script.EVENTS.WAITING_FOR_PLAYERS:Fire(true)
    end
end

function Intermission(time)
    print("Intermission called with time:", time)
    -- Your existing intermission logic
    script.EVENTS.VOTE:Fire()
end

you are quite genius actually impressive and helpful

what i know is that the intermission() is only fired once, but something is firing the event twice

triggering the vote function in the external script twice within half a milisecond

Issue: vote system respawning every time the intermission starts
status: Fixed

It’s fixed? also could there be any other script combatting this one?