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

How do I round to the nearest 3?

The relevant piece of my current code is this:

CurrentBuilding:SetPrimaryPartCFrame(CFrame.new(math.ceil(Mouse.Hit.p.X + 2), math.ceil(Mouse.Hit.p.Y), math.ceil(Mouse.Hit.p.Z + 2)))

How must I alter this to round to the nearest 3?

My intention is to create a grid, with grid spaces 3x3 studs. What methods must I use?

1 answer

✓ Accepted answer

Very simple: math.floor(value/3)*3

1 comment

0

Note if that doesnt work switch the / and * around. Its pretty late (for me its 01:40) so im not sure.

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