diff --git a/content/en-us/education/battle-royale-series/cleanup-and-reset.md b/content/en-us/education/battle-royale-series/cleanup-and-reset.md index 4eb4437c8..793eaeeb2 100644 --- a/content/en-us/education/battle-royale-series/cleanup-and-reset.md +++ b/content/en-us/education/battle-royale-series/cleanup-and-reset.md @@ -483,7 +483,7 @@ local function startTimer() while myTimer:isRunning() do -- Adding +1 makes sure the timer display ends at 1 instead of 0. - timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1)) + timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1 -- By not setting the time for wait, it offers more accurate looping task.wait() end diff --git a/content/en-us/education/battle-royale-series/creating-a-gui.md b/content/en-us/education/battle-royale-series/creating-a-gui.md index c52d60706..c5a5d41db 100644 --- a/content/en-us/education/battle-royale-series/creating-a-gui.md +++ b/content/en-us/education/battle-royale-series/creating-a-gui.md @@ -362,7 +362,7 @@ Remember that module scripts are used to centralize similar code. Since the time ```lua while myTimer:isRunning() do -- Adding +1 makes sure the timer display ends at 1 instead of 0. - timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1)) + timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1 -- By not setting the time for wait, it offers more accurate looping task.wait() end @@ -378,7 +378,7 @@ Remember that module scripts are used to centralize similar code. Since the time while myTimer:isRunning() do -- Adding +1 makes sure the timer display ends at 1 instead of 0. - timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1)) + timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1 -- By not setting the time for wait, it offers more accurate looping task.wait() end @@ -492,7 +492,7 @@ local function startTimer() while myTimer:isRunning() do -- Adding +1 makes sure the timer display ends at 1 instead of 0. - timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1)) + timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1 -- By not setting the time for wait, it offers more accurate looping task.wait() end diff --git a/content/en-us/education/battle-royale-series/ending-matches.md b/content/en-us/education/battle-royale-series/ending-matches.md index 271667ee4..ac72315ea 100644 --- a/content/en-us/education/battle-royale-series/ending-matches.md +++ b/content/en-us/education/battle-royale-series/ending-matches.md @@ -562,7 +562,7 @@ local function startTimer() while myTimer:isRunning() do -- Adding +1 makes sure the timer display ends at 1 instead of 0. - timeLeft.Value = (math.floor(myTimer:getTimeLeft() + 1)) + timeLeft.Value = (myTimer:getTimeLeft() + 1) // 1 -- By not setting the time for wait, it offers more accurate looping task.wait() end diff --git a/content/en-us/luau/metatables.md b/content/en-us/luau/metatables.md index 3f2325d70..7817cb3c8 100644 --- a/content/en-us/luau/metatables.md +++ b/content/en-us/luau/metatables.md @@ -294,7 +294,7 @@ For this one we will be using the `__index` metamethod just to make it simple: ```lua local function mathProblem(num) for i = 1, 20 do - num = math.floor(num * 10 + 65) + num = (num * 10 + 65) // 1 end for i = 1, 10 do num += i - 1 diff --git a/content/en-us/reference/engine/libraries/bit32.yaml b/content/en-us/reference/engine/libraries/bit32.yaml index 5fc6c15ae..04e94aee1 100644 --- a/content/en-us/reference/engine/libraries/bit32.yaml +++ b/content/en-us/reference/engine/libraries/bit32.yaml @@ -451,7 +451,7 @@ functions: For positive displacements, the following equality holds: ```lua - assert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp)) + assert(bit32.rshift(b, disp) == (b % 2^32 / 2^disp) // 1) ``` This shift operation is what is called logical shift. diff --git a/content/en-us/tutorials/use-case-tutorials/lighting/creating-flickering-lights.md b/content/en-us/tutorials/use-case-tutorials/lighting/creating-flickering-lights.md index b2ecc9b71..55bf06fbd 100644 --- a/content/en-us/tutorials/use-case-tutorials/lighting/creating-flickering-lights.md +++ b/content/en-us/tutorials/use-case-tutorials/lighting/creating-flickering-lights.md @@ -147,7 +147,7 @@ end RunService.Heartbeat:Connect(function() -- Solves for the NumberSequence's time (between 0 and 1). local t = time() / loopDuration - local numberSequenceTime = t - math.floor(t) + local numberSequenceTime = t - (t // 1) -- Gets the NumberSequence's value at this time. local brightnessValue = evaluateNumberSequence(brightnessCurve, numberSequenceTime) diff --git a/content/en-us/ui/3D-drag-detectors.md b/content/en-us/ui/3D-drag-detectors.md index b3d3d6976..92ef75530 100644 --- a/content/en-us/ui/3D-drag-detectors.md +++ b/content/en-us/ui/3D-drag-detectors.md @@ -398,14 +398,14 @@ local function snapToWorldGrid(proposedMotion) if startPartPosition == nil then return proposedMotion end - local snapIncrement = math.floor(SNAP_INCREMENT) + local snapIncrement = SNAP_INCREMENT // 1 if snapIncrement < 1 then return proposedMotion end local newWorldPosition = startPartPosition + proposedMotion.Position - local roundedX = math.floor(newWorldPosition.X / snapIncrement + 0.5) * snapIncrement - local roundedY = math.floor(newWorldPosition.Y / snapIncrement + 0.5) * snapIncrement - local roundedZ = math.floor(newWorldPosition.Z / snapIncrement + 0.5) * snapIncrement + local roundedX = ((newWorldPosition.X / snapIncrement + 0.5) // 1) * snapIncrement + local roundedY = ((newWorldPosition.Y / snapIncrement + 0.5) // 1) * snapIncrement + local roundedZ = ((newWorldPosition.Z / snapIncrement + 0.5) // 1) * snapIncrement local newRoundedWorldPosition = Vector3.new(roundedX, roundedY, roundedZ) return proposedMotion.Rotation + (newRoundedWorldPosition - startPartPosition) end