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

Countdown Gui with decimals, adding random 0s or 9s to the end. Whats wrong with it?

Hello, I have been making a count down with decimals but I run it seems to add 0s or 9s to the end. Depending if I use IntValue or NumberValue. Here is my code:

script.Parent.MID.Text = m..":"..s
while true do
	if s <= 0.00 then
			if m == 0 then
				break;
			else
				m=m -1
				s = 58.99
			end
		else
		s = s-.01
		end	
	if s <= 9.99 then
		script.Parent.MID.Text= m..":0"..s
	else
		script.Parent.MID.Text= m..":"..s
	end
	wait(.01)
end

Thanks.

1 answer

Solved. New script if you need it.

runservice.Stepped:Connect(function()
if not done then	
		if ms == 0 then
			if s == 0 then
				
				if m == 0 then
			script.Parent.MID.Text = "00:00.00"
		else
			m=m -1
					s = 58
					ms = 99
				end
				
			else
				s = s-1
				ms = 99
		end
		
	else
		ms = ms-3
	end	
		script.Parent.MID.Text= m..":"..s.."."..ms
	
		if s < 10 then
			script.Parent.MID.Text= m..":0"..s.."."..ms
		else
			script.Parent.MID.Text= m..":"..s.."."..ms
		end
	wait(0.03)
	else
		script.Parent.MID.Text = "00:00.00"
		script.Disabled = true
	end
end

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