Alt Detection Help

I’m looking for a way to round decimal places with the new alt detection method. (os.clock() CPU Time)

tick()-os.clock() -- 1705518984.3234065

It gives me a decimal value but I’m looking to round it up by 4 decimals so it is more accurate. I want to do this so the chances of giving the same CPU Time as another computer is like 0.0001% and when banning someone and putting their CPU Time in a list it won’t give the same CPU Time for another player that’s not one of their alts.

Using math.round I was able to get it to around 2 decimal places but I don’t think it’s accurate enough.

math.round(1705518984.3234065 * 100) /100 -- 1705518984.32

There’s probably better ways of doing it, than using math.round but its all I could figure out.

function Round(n, decimals)
	decimals = decimals or 0
	return math.floor(n * 10^decimals) / 10^decimals	
end

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