I feel Really stupid right now, anyways i’m making a donation board system and i want to make a timer to indicate when the board is going to update but the text doesnt change why? not sure.
local function Timer()
local time = 2
while wait(2) do
if time == 0 then
gui.main.Title.text = "Updating Donation Board"
break
else
warn(tostring(time))
time = time - 1
end
end
end
while true do
Timer()
end
local function Timer()
local Time = 2
for i = Time, 0, -1 do
task.wait(1)
end
gui.main.Title.text = "Updating Donation Board"
end
while true do
Timer()
end
You may want to change the text afterwards so that it isn’t stuck.
The text Donations didnt change but the print statment worked
local function Timer()
local Time = 2
for i = Time, 0, -1 do
task.wait(1)
end
gui.Main.Title.Text = "Updating Donation Board in "..tostring(Time)
print("Updating")
end
Pretty sure its just a Surfacegui problem i even tried doing it so like
local function Timer()
local Time = 2
for i = Time, 0, -1 do
task.wait(1)
end
gui.Main.Title.Set.Value = "Updating Donation Board in "..tostring(Time)
gui.Main.Title.Text = gui.Main.Title.Set.Value
end
Ah get the issue. You just need to put the line you’re changing the text inside the for loop. Here’s the full code now:
local function Timer()
local Time = 2
for i = Time, 0, -1 do
task.wait(1)
gui.Main.Title.Set.Value = "Updating Donation Board in "..tostring(i)
gui.Main.Title.Text = gui.Main.Title.Set.Value
end
end
The reason why you need to do this, is because the text and the value will change after the for loop is over.
Edit
Fixed a little bit of issues with the script. It should be perfect now!
Grammar correction. (Excuse me with my terrible grammar)
so at the screen shot where i replied to fourmer about that big donation text thats where the text is suppose to go and i dont think it has anything to do with transparency since the text is already visiable pretty sure its a surfacegui issue but thanks for the reply
something is not right on your end which is why I’m saying it is changing, but its invisible for whatever reason, its just speculation though cause idk what u mean by surface gui issue, if you are indeed setting the .text then it should change
local textlabel = script.Parent.TextLabel
for i=30, 0, -1 do
textlabel.Text="timer = " .. i
wait(1)
end
local function Timer()
local Time = 2
for i = Time, 0, -1 do
task.wait(1)
gui.Main.Title.Set.Value = "Updating Donation Board in "..tostring(i)
gui.Main.Title.Text = gui.Main.Title.Set.Value
end
end
that is very weird and I don’t think anyone can help just by looking at code (the code is functional too) because there is a different underlying issue
Is it possible to post the donation board itself so I can download and check around myself?
Not sure, what’s the problem. But maybe try this, I guess?
local function Timer()
local Time = 2
for i = Time, 0, -1 do
task.wait(1)
gui.Main.Title.Set.Value = "Updating Donation Board in "..tostring(i)
end
end
gui.Main.Title.Set:GetPropertyChangedSignal("Value"):Connect(function(changedValue)
gui.Main.Title.Text = changedValue
end)