someone help me with this math problem in my script
I am trying to transform a Falor (Seconds) in hours and minutes and make it a formed one like for example (00:00:00) more with this script I made it a bug that goes both for hours and minutes and seconds -30 to 30 (the range would be from 0 to 60) if you can help me … please ;-;
My Script
local DataStore = game:GetService("DataStoreService")
local DataBoard = DataStore:GetDataStore("DataBoard")
local DataPlayed = DataStore:GetDataStore("SecoundsPlayed".."1")
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder", player) leaderstats.Name = "leaderstats"
local SecoundsPlayed = Instance.new("IntValue", player) SecoundsPlayed.Name =
"SecoundsPlayed"
SecoundsPlayed.Value = DataPlayed:GetAsync(player.UserId) or 0
local debaunce = false
while true do
SecoundsPlayed.Value = SecoundsPlayed.Value +1
local Hours = Instance.new("IntValue")
local Minutes = Instance.new("IntValue")
local Secounds = Instance.new("IntValue")
Hours.Value = SecoundsPlayed.Value/3600
Minutes.Value = (SecoundsPlayed.Value/60)-(60*Hours.Value)
Secounds.Value = (SecoundsPlayed.Value) - (60*Minutes.Value)
local TH = ""
local TM = ""
local TS = ""
if Secounds.Value < 10 then
TS = "0"..Secounds.Value
else
TS = Secounds.Value
end
if Minutes.Value < 10 then
TM = "0"..Minutes.Value
else
TM = Minutes.Value
end
if Hours.Value < 10 then
TH = "0"..Hours.Value
else
TH = Hours.Value
end
print(TH..":"..TM..":"..TS)
wait(1)
end
end)