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

I'm trying to make a timer, but it isn't working. Number values aren't working either. Why is this?

Asked by 6 years ago
Edited 6 years ago

So I'm trying to make a timer, but the code isn't working. I've tried adding a number value, but it didn't work. Here is my script:

local ltime = script.Parent.Value

while true do
    script.Parent.Text = "Time alive:"..ltime
    wait(1)
    ltime = ltime + 1
end

Also, forgot to mention this, the textbox's text only says "TextBox".

If you need the order of the things that I have in the StarterGUI, click the link here.

1 answer

Log in to vote
0
Answered by 6 years ago

You're trying to store an integer value in a Value field, and a string value in a Text field. No instance has both of those properties.

Now, assuming you put this script inside of a TextBox

local textbox = script.Parent
local timealive = 0

while true do
    textbox.Text = ("Time alive:" .. timealive)
    wait(1)
    timealive = timealive + 1
end
Ad

Answer this question