Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Round timer not converting seconds to minutes correctly?

When it converts the seconds to minutes it will be like 1.88:00 or it will be 1:70 and keep counting down in decimals in the minutes or go above 60 in seconds

function convertSecondsToMinutes(seconds)
	local minutes = math.floor((seconds/60)-0.5)

	local rseconds = seconds - (minutes*60)
	
	if minutes < 1 and minutes > 0 then
		minutes = 0
		rseconds = seconds
	end
	
	return minutes..":"..rseconds
end

1 answer

✓ Accepted answer

6 comments

0

That just makes it go to i:i:i doesn't show time

0

It's because of RegEx parsing in the website, it's annoying. You need: percent zero two i.

0

What are you looking for then? Just minutes and seconds?

0

The above code translates seconds into hour:minute:second, but can be shorted to just minutes:seconds if thats what you wanted, otherwise I guess I am misunderstanding your question.

0

That is what i was trying to do, just minutes and seconds, but your code when i put it in, it didnt translate the seconds to anything, just set the text to i:i:i

0

Oh oops, I overlooked that, I am sorry! I updated my answer, and also showed a few ways to shorten it to just minutes:seconds

This discussion is preserved as it was. New answers, comments, and votes are closed.