File tree Expand file tree Collapse file tree 7 files changed +12
-12
lines changed
education/battle-royale-series
reference/engine/libraries
tutorials/use-case-tutorials/lighting Expand file tree Collapse file tree 7 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ local function startTimer()
483483
484484 while myTimer :isRunning () do
485485 -- Adding +1 makes sure the timer display ends at 1 instead of 0.
486- timeLeft .Value = (math.floor ( myTimer :getTimeLeft () + 1 ))
486+ timeLeft .Value = (myTimer :getTimeLeft () + 1 ) // 1
487487 -- By not setting the time for wait, it offers more accurate looping
488488 task .wait ()
489489 end
Original file line number Diff line number Diff line change @@ -362,7 +362,7 @@ Remember that module scripts are used to centralize similar code. Since the time
362362 ``` lua
363363 while myTimer :isRunning () do
364364 -- Adding +1 makes sure the timer display ends at 1 instead of 0.
365- timeLeft .Value = (math.floor ( myTimer :getTimeLeft () + 1 ))
365+ timeLeft .Value = (myTimer :getTimeLeft () + 1 ) // 1
366366 -- By not setting the time for wait, it offers more accurate looping
367367 task .wait ()
368368 end
@@ -378,7 +378,7 @@ Remember that module scripts are used to centralize similar code. Since the time
378378
379379 while myTimer :isRunning () do
380380 -- Adding +1 makes sure the timer display ends at 1 instead of 0.
381- timeLeft .Value = (math.floor ( myTimer :getTimeLeft () + 1 ))
381+ timeLeft .Value = (myTimer :getTimeLeft () + 1 ) // 1
382382 -- By not setting the time for wait, it offers more accurate looping
383383 task .wait ()
384384 end
@@ -492,7 +492,7 @@ local function startTimer()
492492
493493 while myTimer :isRunning () do
494494 -- Adding +1 makes sure the timer display ends at 1 instead of 0.
495- timeLeft .Value = (math.floor ( myTimer :getTimeLeft () + 1 ))
495+ timeLeft .Value = (myTimer :getTimeLeft () + 1 ) // 1
496496 -- By not setting the time for wait, it offers more accurate looping
497497 task .wait ()
498498 end
Original file line number Diff line number Diff line change @@ -562,7 +562,7 @@ local function startTimer()
562562
563563 while myTimer :isRunning () do
564564 -- Adding +1 makes sure the timer display ends at 1 instead of 0.
565- timeLeft .Value = (math.floor ( myTimer :getTimeLeft () + 1 ))
565+ timeLeft .Value = (myTimer :getTimeLeft () + 1 ) // 1
566566 -- By not setting the time for wait, it offers more accurate looping
567567 task .wait ()
568568 end
Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ For this one we will be using the `__index` metamethod just to make it simple:
294294``` lua
295295local function mathProblem (num )
296296 for i = 1 , 20 do
297- num = math.floor (num * 10 + 65 )
297+ num = (num * 10 + 65 ) // 1
298298 end
299299 for i = 1 , 10 do
300300 num += i - 1
Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ functions:
451451 For positive displacements, the following equality holds:
452452
453453 ```lua
454- assert(bit32.rshift(b, disp) == math.floor (b % 2^32 / 2^disp))
454+ assert(bit32.rshift(b, disp) == (b % 2^32 / 2^disp) // 1 )
455455 ```
456456
457457 This shift operation is what is called logical shift.
Original file line number Diff line number Diff line change 147147RunService .Heartbeat :Connect (function ()
148148 -- Solves for the NumberSequence's time (between 0 and 1).
149149 local t = time () / loopDuration
150- local numberSequenceTime = t - math.floor ( t )
150+ local numberSequenceTime = t - ( t // 1 )
151151
152152 -- Gets the NumberSequence's value at this time.
153153 local brightnessValue = evaluateNumberSequence (brightnessCurve , numberSequenceTime )
Original file line number Diff line number Diff line change @@ -398,14 +398,14 @@ local function snapToWorldGrid(proposedMotion)
398398 if startPartPosition == nil then
399399 return proposedMotion
400400 end
401- local snapIncrement = math.floor ( SNAP_INCREMENT )
401+ local snapIncrement = SNAP_INCREMENT // 1
402402 if snapIncrement < 1 then
403403 return proposedMotion
404404 end
405405 local newWorldPosition = startPartPosition + proposedMotion .Position
406- local roundedX = math.floor ( newWorldPosition .X / snapIncrement + 0.5 ) * snapIncrement
407- local roundedY = math.floor ( newWorldPosition .Y / snapIncrement + 0.5 ) * snapIncrement
408- local roundedZ = math.floor ( newWorldPosition .Z / snapIncrement + 0.5 ) * snapIncrement
406+ local roundedX = (( newWorldPosition .X / snapIncrement + 0.5 ) // 1 ) * snapIncrement
407+ local roundedY = (( newWorldPosition .Y / snapIncrement + 0.5 ) // 1 ) * snapIncrement
408+ local roundedZ = (( newWorldPosition .Z / snapIncrement + 0.5 ) // 1 ) * snapIncrement
409409 local newRoundedWorldPosition = Vector3 .new (roundedX , roundedY , roundedZ )
410410 return proposedMotion .Rotation + (newRoundedWorldPosition - startPartPosition )
411411end
You can’t perform that action at this time.
0 commit comments