okay so i have been trying to make a block place script but i need to round to the nearest five for it to work here is my current script:
function round(x)
return(math.floor(math.floor(x + 0.5)/5)*5)
end
it doesent work propely, for example if i run this script:
function round(x)
return(math.floor(math.floor(x + 0.5)/5)*5)
end
for i = 0,25 do print(round(i)) end
if outputs:
0 (x5)
5 (x5)
10 (x5)
15 (x5)
20 (x5)
25
it outputs because it doesent round to the nearest five it rounds to the five under it, does anyone know any way to fix any help is appreciated

3 comments
Do this: "if num % 5 == 0 then".
Or use math.ceil().
what do you mean by that?