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

Countdown not working because of a local error. Anyone help?

Asked by 8 years ago
Edited 8 years ago

So, I was developing the countdown section, and when I wanted to test the countdown, it didn't work because of this error:

19:07:42.765 - Workspace.Script:10: attempt to call local 'supernewvalue' (a number value)
19:07:42.767 - Stack Begin
19:07:42.767 - Script 'Workspace.Script', Line 10
19:07:42.767 - Stack End

The countdown script is located inside the workspace. The Int is located inside the workspace too.

And the TextBox is located inside game > StarterGui > ScreenGui > TextBox.

Hope you can help me!

local Int = workspace.Int.Value



while true do
    wait(0.001)
    local newvalue = Int - 1
    wait(1)
local supernewvalue = newvalue      
    game.StarterGui.ScreenGui.TextBox.Text = 'You have'..supernewvalue'till we start!'
    if newvalue == 0 then

        break
    end
end

0
There are a lot of small problems here that can be resolved with debugging. User#5423 17 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

You forgot the ..

..supernewvalue..' till we start!'

Also

game.StarterGui

https://scriptinghelpers.org/blog/common-mistakes#PlayerGui

1
Nice one. User#11440 120 — 8y
0
Can I have an example of it? Because I tried :GetService with StarterGui. Didn't work. Syntax_404 37 — 8y
1
Use the Local Player's PlayerGui. Also, read the link. User#11440 120 — 8y
0
Thanks. Syntax_404 37 — 8y
Ad

Answer this question