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

Very simple problem, hopefully someone can help me with it?

Asked by 6 years ago

I need to add both some text and a value into the same textlabel. So, I have a countdown and I want to make the text label say, "(number) seconds remaining!" Does anyone know how do this?

0
Hope that helps! Amanda314159 291 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Try this

for count = 1, 100 do
    wait(.1)
    Value = Value + 1
    Text = Value.. ' seconds remaining!'
end
Ad
Log in to vote
0
Answered by 6 years ago

Honestly, I'd say to make a text-changing function (But I'm pretty lazy xD) This is what I would do:

function updateText(message)
    game.StarterGui.ScreenGui.TextLabel.Text = message -- Make sure that the location is correct
end

You could then use the function above to change text whenever

local timer = 30 -- Change number to however many seconds you want
while timer > 0 do
    updateText(timer.. " seconds remaining!")
    wait(1)
    timer = timer - 1
end

Answer this question