Rounds and intermissions scripts not working

Try this as your new server script.

local roundLength = 5 -- How long the round is in seconds
local intermissionLength = 10 -- How many seconds are inbetween the rounds

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, 1, -1 do
			InRound.Value = false
			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

roundTimer()

Did not work for some reason…

Do you know if its passing through the loops

Do you have a Drafts tab somewhere inside your Studio? If you do, find it by searching:

View > Drafts

I have no idea. I’m not good at scripting :sweat_smile:

I don’t see anything. What do drafts do?

Your most valuable resource is print

It’s bad practice but if you print something to console like a number and just have that between ever line then you can see what’s not running.

Basically just have print(numberhere) between each line.

1 Like

use prints to debug your code–see what’s working

1 Like

Drafts are just basically a way of committing scripts (Or verifying them to the server)

If you have to, literally print each line individually to see what outputs back

1 Like

Done that. Here’s what works.


The spawn of the roundtimer does not work, and the changing also doesn’t.

try using this for local:

Status:GetPropertyChangedSignal("Value"):Connect(function()
	TimerDisplay.Text = Status.Value
end)

If this doesn’t work I don’t know what will, we clearly see that it goes through the loops, its just not detecting change. I hope it isn’t because Status is not a StringValue object

This also didn’t work. I guess I’ll just go over everything in the video again and see if i missed a step. (Which I highly doubt because I’ve checked multiple times)

Ok, well I suppose we can break it down to the LocalScript here:

local Status = game.ReplicatedStorage:WaitForChild("Status")
local TimerDisplay = script.Parent.TimerDisplay
print("Working")
print(Status.ClassName)--This will check what the VALUE REALLY IS REEE

Status.Changed:Connect(function()
    print("What")
	TimerDisplay.Text = Status.Value
end)

Try this, if Status prints as a different object & not a “StringValue” then you have the “Value Object” wrong

make sure status is an actual string value object not a bool value or int value.

1 Like

Doesn’t work. It did something but the script didn’t finish

image

BAM, That’s the reason why

Change it to a “StringValue” and you should be all set!

1 Like

its an int value, delete it from replicated storage and make a string value object

1 Like

Oh the tutorial said one needed to be int and the other bool. Could that be the problem?

The tutorial probably got confused of the values

It’s actually supposed to be a string value, (Or this: "Hello! This is a string")

IntValues are values that can store a lot of Integers (Or whole numbers)

Just change it to that, and it should work!

1 Like

The tutorial probably demonstrated only showing the number itself, i.e. a count down timer. Not what you’re trying to do in the script, you are adding letters and numbers.

1 Like