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

Why does this error when I stop the timer? Got boolean?

local Time = game.Workspace.Intermission.Value
local Game = game.Workspace.Game.Value

while true do
	script.Parent.Text = Time
	wait(1)
	Time = Time -1
	if Time == 0 then
		Time = Time -1 == false
	end
end

Error: (string expected, got boolean)

1 comment

0

Simply put, it appears you referred to a string with a math equation. You tried to change a text value to a Int or Bool value, depending on which is Time.

3 answers

I have found a solution, here it is:

-- fixed by DetectiveRaie
local Time = game.Workspace.Intermission.Value

while true do
    script.Parent.Value = Time
    wait(1)
    Time = Time -1
    if Time == 0 then
        Time = Time -1 == false
	print("Time's up!")
    end
end

Make sure you place the script correctly: http://prntscr.com/s2l99i

Fixed:

local Time = game.Workspace.Intermission.Value
local Game = game.Workspace.Game.Value

	 script.Parent.Text = Time
 
while Time == 0 do
	    wait(1)
	    Time = Time -1
	end

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