Help with Round system

You can write your topic however you want, but you need to answer these questions:

  1. **What do you want to achieve? I’m making a round system for my game and its not working

  2. **What is the issue?

    ![Screenshot_39|690x343]Screenshot_38 it’s supposed to count down like in the tutorial I was following but it’s not and I looked back in the code to be sure.

2 Likes

in the video it counted down but my text wont do that

Please help if you know how to fix this!

U never told to the script count down (call RoundTimer)

1 Like

First of all in the first script i see you made it a function but did not run it.
Please show what the error is and if you watched it from a tutorial it is either outdated or you made a mistake.

1 Like

It’s from march 10th 2020
(30 Characters)

I’m pretty sure in that tutorial you need to add at the end:

spawn(roundTimer)

Should be correct.

1 Like

Still nothing i looked back and saw that :confused:

U never called roundTimer() so the script just ends

I updated it image

I think found the bug!

local InRound = game.ReplicatedStorage.InRound

You forgot to change the InRound Value to InRound.

1 Like

Hold on im going to check

(30 Characters)

1 Like

nope still nothing but here is the whole code `local roundLength = 5
local intermissionLength = 10
local InRound = game.ReplicatedStorage.InRound
local Status = game.ReplicatedStorage.Status

local LobbySpawn = game.Workspace.LobbySpawn
local GameAreaSpawn = game.Workspace.GameAreaSpawn

local function roundTimer()
while wait() do
for i = intermissionLength, 0, -1 do
InRound.Value = false
wait(1)
Status.Value = “Intermission: “… i …” seconds left!”
end
for i = roundLength, 0, -1 do
InRound.Value = true
wait(1)
Status.Value = “Game: “… i …” seconds left!”
end
end
end
spawn(roundTimer)

`

1 Like

In order for the function roundTimer() to begin, you must call it at the end of the script. You can do so by simply adding

roundTimer()

I’ve never used spawn(roundTimer) before so it may not work, I’ve never even heard of it, but perhaps that’s just me.

3 Likes

Is your InRound Value a BooleanValue and is your status a StringValue?

1 Like

I believe that is the solution since you need to call the function. The loop or anything inside the function will never happen if it never gets called.

1 Like

image still nothing are you talking about the first script or the second?

1 Like

Yeah, spawn is primarily for calling functions on other threads. This is kind of a work-around to multi-threading in scripts. He doesn’t need that though, so just calling it should work.

1 Like

First script. The second script does not have a roundTimer() function mentioned within it.

1 Like

What I would recommend is using the printing method to debug this. Put prints inside the for loops. Tell us what the output says.

2 Likes