Soo I’m making a time leaderboard and it will not show the minutes. I think the problem is here but im a pretty novice scripter/builder and i have no idea why this is not showing the minutes. The goal is to make a Global leaderboard script that prints it our on a part.
local function cal_time(_time)
_time = _time * 60
local days = math.floor(_time/86400)
local hours = math.floor(math.fmod(_time, 86400)/3600)
local minutes = math.floor(math.fmod(_time,3600)/60)
return string.format("%02dd : %02dh : %02dm",days,hours,minutes)
end
Any suggestions or help would be appreciated. I literally have no clue what I’m doing wrong.
local function cal_time(totalMinutes: number): string
totalMinutes *= 60
local days: number = math.floor(totalMinutes/86400)
local hours: number = math.floor(math.fmod(totalMinutes, 86400)/3600)
local minutes: number = math.floor(math.fmod(totalMinutes, 3600)/60)
return string.format("%02dd : %02dh : %02dm", days, hours, minutes)
end
print(cal_time(100)) --//Prints 00d : 01h : 40m
Are you sure you’re inputting the correct amount of minutes?
Hm haven’t tried printing it yet. It’s a good idea tho. The GUI is fine i think. The place where the minutes are supposed to go are blank tho. Like 0 input.
Sorry, went out for a bit; That means your GUI is clipping. The text is too long (wide) for how wide your label is. Modify TextSize, enable TextScaled, or make the label bigger.