hello there, as the title says, im having trouble trying to make a timer that shows the milisecs. here’s how i do all the maths:
local roundTime = 500
repeat
wait(.1)
roundTime -= 1
until roundTime == 0 or Valores.PR.Value == Valores.PTW.Value -- runs the timer until it reaches 0 or when all the players have won.
if roundTime ~= 0 and actualRoundTime > 150 then -- if all players have won, then the time on the next round will be much lower than roundTime substracted by .5
roundTime = math.floor(actualRoundTime-((roundTime * .1)+5))
actualRoundTime = roundTime
elseif roundTime == 0 and actualRoundTime > 150 then -- if the round ended because time ended, then it'll just substract .5 to the roundTime
roundTime = actualRoundTime-5
actualRoundTime = roundTime
else -- lower cap of time
roundTime.Value = 150
actualRoundTime = 150
end
the problem here comes when i want to change the milisecs to seconds, since for that i just need to do milisecs * .1, but when i do that, it prints this:
i also tried with math.round(milisecs) * .1 but it ends up like the same.
thanks to everyone who replies :DD (and sorry if i have bad grammar, i don’t speak english)
math.round(x*1000)/1000 -- 1000 if you want milliseconds
change the 10s to whatever decimal you want to round it to. This also rounds the number, if you don’t want to round the number, you should use math.floor() instead of math.round()