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 4 years ago
local Time = game.Workspace.Intermission.Value
local Game = game.Workspace.Game.Value

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

if Time == -1 then
        script.Parent.Text = Time == false
    if Time == false then
        wait(1)
        script.Parent.Text = Game
        Game = Game - 1
    end 
    end
end

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 4 years ago
time == false

gives a boolean

you can fix it by doing

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

Answer this question