Hello! I was making a time elapsed display for a game, but I came across an error: When the minutes passed 60, it kept going past 60 (i.e. 61, 62, 82, 192, etc.). The hour indicator increases accordingly, but the minute indicator allows itself to go over.
Here is the script I am having troubles with:
local initTime = tick()
local mula = game.Players.LocalPlayer.leaderstats.Cash.Value
while wait(1) do
local profit = game.Players.LocalPlayer.leaderstats.Cash.Value - mula
local timeElap = tick() - initTime
local hour = math.floor(timeElap / 60 / 60)
local min = math.floor(timeElap / 60)
local sec = timeElap - min*60
sec = math.floor(sec)
amount1.Text = hour..":"..min..":"..sec
amount2.Text = "$"..profit
end
Thanks,
- Ham