#Is there a similar math function to math.clamp?
14 messages · Page 1 of 1 (latest)
I can't compile LaTeX in this thread as I lack the SEND_MESSAGES permission in the origin channel (#1020374354867007528)! Please check my permissions and try again.
local min(m, n)
if n < m then
return m
else
return n
end
end
min(1,2) - - 2
min(2,1) - - 2
I can't compile LaTeX in this thread as I lack the SEND_MESSAGES permission in the origin channel (#1020374354867007528)! Please check my permissions and try again.
I can't compile LaTeX in this thread as I lack the SEND_MESSAGES permission in the origin channel (#1020374354867007528)! Please check my permissions and try again.
u dont want it to go any more lower than 0?
I can't compile LaTeX in this thread as I lack the SEND_MESSAGES permission in the origin channel (#1020374354867007528)! Please check my permissions and try again.
if so use math.max(0, n)
I can't compile LaTeX in this thread as I lack the SEND_MESSAGES permission in the origin channel (#1020374354867007528)! Please check my permissions and try again.
oh ok thanks a lot!
I can't compile LaTeX in this thread as I lack the SEND_MESSAGES permission in the origin channel (#1020374354867007528)! Please check my permissions and try again.
or math.clamp(x, 0, math.huge)
I can't compile LaTeX in this thread as I lack the SEND_MESSAGES permission in the origin channel (#1020374354867007528)! Please check my permissions and try again.
thought of that , but i think math.huge takes a bit more memory