How to change a text every second which is connect to a module

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to Change text to Text -1 every second
  2. What is the issue? Include screenshots / videos if possible!
    attempt to compare number < string, I understand why this error occurs but Have no I idea how to fix it

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local Gui = script.Parent

local Frame = Gui:WaitForChild("Frame")

local Menoloka= require(game:GetService("ReplicatedStorage"):WaitForChild("Menoloka")

for i , v in pairs(Frame:GetDescendants()) do
	if v:IsA("TextLabel")  then
		v.Text = Menoloka[v.Name]["TimeThing"]

		while v.Text >0 do
			v.Text = v.Text - 1
			task.wait(1)

		end
	end
end

The tonumber() function is useful to convert strings to numbers, try converting the text into a number before subtracting 1, you can’t subtract a number from a string :+1:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.