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

i need help in doing a intermisson countdown timer i cant get it right it says error?

local GameLength = 300
local IntermissonLength = 30
local reward = 100

local victory = 1

-- Game Loop

while true do
	
    Status.Value = "Waiting for enough players..."
	
	repeat wait(0.5) until game.Players.NumPlayers >= 2
	
	for e = IntermissonLength,0,-1
	
	Status.Value = "Intermisson "..e..
			wait(30)

it has a red line under the status in Status.Value = "Intermisson" which should be bolded. I want it to show on the players screen Intermisson 30 and count down from there. it has a error which i do not understand how to fix.

1 comment

0

i tried putting do after " for e = IntermissonLength,0,-1 " and it still broke the whole script

1 answer

Well, in Line 15, you forgot to add do at the end of for loop statement to make the system understand that loop is being commanded. The structure, of for loop :

for i = 1, 0, -1 do
	print('Test')
end

So, the loop, in verbal (simple words), means that 'for a variable i (e.g.), whose value is 1 must stop the loop upon reaching 0, with 1 decrement (or -1 increment) and do the thing inside it until the loop ends, here (e.g.), printing Test'.

So, you just need to add do at the end. Also, if you already tried adding do, make sure you have end for the loop. Here, it should look like :

for e = IntermissonLength,0,-1 do -- Add do
	-- Your code
end -- Make sure to add a end for the loop, if there is not

Lemme know if it helps!

3 comments

0

ok i did it and it works like half way now, it says intermisson 30 like its supposed too on a players screen but it goes from intermisson 30 to intermisson 29 every 10ish seconds

0

Can you provide the whole edited code?

0

shadoww#0702 add me on discord it will be eaiser to send it all

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