Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my timer error when I try to switch to another timer?

Asked by 5 years ago
01local Time = game.Workspace.Intermission.Value
02local Game = game.Workspace.Game.Value
03 
04while true do
05wait(1)
06script.Parent.Text = Time
07Time = Time - 1
08 
09if Time == -1 then
10        script.Parent.Text = Time == false
11    if Time == false then
12        wait(1)
13        script.Parent.Text = Game
14        Game = Game - 1
15    end
16    end
17end

Time = the Intermission Time "15"

Game = the Game Time "60"

The error says: Players.NiceDerpling.PlayerGui.ScreenGui.TextBox.Script:10: bad argument #3 (string expected, got boolean)

1 answer

Log in to vote
1
Answered by 5 years ago
1time == false

gives a boolean

you can fix it by doing

1tostring(time == false)
0
I have never heard of tostring before I will definitely try it out! NiceDerpling 14 — 5y
1
Did it work? herokuwu 41 — 5y
Ad

Answer this question