Time script not showing minutes

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.

2 Likes

Could you send your entire code?

1 Like

why are you going through that much effort to make a Timer that advanced?

1 Like

The number converting function works for me:

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?

2 Likes

I thinki am, i have a data storage script and a script that adds every 60 ticks 1 to the value to the data storage value.

1 Like

Is it a problem with GUI clipping? What happens if you print the time?

2 Likes

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.

1 Like

It does print it correctly. Sorry for the late response i needed to sleep. i added the print to the up_board function.

If you print the “score” value in up_board, what does it output?

If it has the minutes, your GUI is clipping, and you should either lower TextSize or enable TextScaled

1 Like

It prints correctly
image_2022-11-07_101337236

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.

Hope this helps, cheers.

1 Like

dam okay thanks. It works now. Thank you so much for your help

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