Hey there!
I’m making a Daily Reward system and I watched a lot of videos on it, everything is working but I want to make a chrono under the dailyReward to know if you can claim it or how much time you have to wait.
So i went on a function like this:
local function convertTime(n)
local String
local hours = (math.floor(n / 3600))
local minutes = (math.floor((n - (hours*3600)) / 60))
local seconds = (math.floor(n-(hours*3600)-(minutes+60)))
if hours <= 9 then
hours = "0"..hours
end
if minutes <= 9 then
minutes = "0"..minutes
end
if seconds <= 9 then
seconds = "0"..seconds
end
if hours ~= 0 and minutes ~= 0 and seconds ~= 0 then
String = hours..":"..minutes..":"..seconds
else
String = "Ready to claim!"
end
return String
end
while wait(1) do
if lastClaim then
text.Text = convertTime(os.time() - lastClaim)
end
end
So it gives me the time between the last Claim so I give me 35 minutes and 2000 seconds it’s why I don’t understand ;-:.
So How can I fix this to give me something like : “Next in: 09:57:30”.
Thank you!