Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I am trying to make a round script for the seconds to count down but it isn't working help?

hello i am trying to create a round script for my game but when i test it, it does nothing please help (it is meant to count down)

local roundlength = 5
local intermission length = 10
local inround = game.ReplicatedStorage.InRound
local status = game.ReplicatedStorage.status

local lobbySpawn = game.Workspace.GameAreaSpawn



local function RoundTimer()
	while wait() do
		for i = intermissionLength, 1, -1 do
			InRound.value = false
			wait (1)
			status.value = "Intermission: "..i.." secounds left!"
			end
			for i = roundlength, 1, -1 do
				InRound.value = false
				wait (1)
				status.value = "game: "..i.." secounds left!"  
		end
	end
end
spawn(RoundTimer)

1 answer

✓ Accepted answer

You forgot to close the space. Code in Lua cannot have spaces.

local roundLength = 5
local intermissionLength = 10 -- You had a space: 'intermission length'
local inround = game.ReplicatedStorage.InRound
local status = game.ReplicatedStorage.status

local lobbySpawn = game.Workspace.GameAreaSpawn



local function RoundTimer()
    while wait() do
        for i = intermissionLength, 1, -1 do
            inround.value = false -- You have to correspond to the variable. You wrote 'InRound'
            wait (1)
            status.value = "Intermission: "..i.." seconds left!"
        end
        for i = roundLength, 1, -1 do
                InRound.value = false
                wait (1)
                status.value = "game: "..i.." seconds left!"  
        end
    end
end
spawn(RoundTimer)

This should work! Hopefully it helped!

2 comments

0

sorry what do you mean space?

0

I think I know thank you so much

This discussion is preserved as it was. New answers, comments, and votes are closed.