Advanced Roblox Scripting Tutorial #18 - Math Functions (Beginner to Pro 2019)

preview_player
Показать описание
Advanced Roblox Scripting Tutorial #18 - Math Functions (Beginner to Pro 2019)

Hey guys! Welcome back to a brand new roblox scripting tutorial. In today's tutorial I am going to be teaching you the math functions of lua. Math functions are the built in functions that you can use for basic things such as rounding, squaring, getting absolute values, random numbers, and more! You'll definitely be using these when scripting so I thought it would be a good idea to teach you! Enjoy the tutorial.

--Join my Discord Server to learn and meet other developers!--



Link to Beginner's Tutorial Series:

--What is this series about and who is it for?

So this series is meant for people who really want to learn exactly how to script, if that is you then I promise by the time you watch this whole series you will know exactly how to script on roblox. Anyways be sure to subscribe to see whenever I release a new tutorial and I will see you guys in the next one. Peace!
Рекомендации по теме
Комментарии
Автор

I started napping while watching your video and you managed to sneak in as the radio into my dream.
I woke when I realized the car stereo was going over roblox math functions.

kevinscott
Автор

What have I learned? there is a huge seal on the floor with random things WHICH IS TOTALLY RAD, and the seal got cold so it turned up the thermostat in degrees, then it had pie, and suddenly POW! It has abs, the end!

oscoolerreborn
Автор

math is more fun when you don't have to do it. that's why i like these functions :>

sentientsodacan
Автор

one function he didn't use was math.clamp(number x, min, max). You pretty much put your number, the minimum it can go, and the max. It makes it so your number never passes your min and max.

TumbleWede
Автор

Its been a year since this series start WOW

dangerdayan
Автор

this guy right here taught me math more than all of my teachers😂

coolguy-lxfy
Автор

When you learn more math from a roblox dev than from school

honkhonk
Автор

Hey, thanks for these tutorials. I really appreciate it.

ipoststuff.
Автор

when a coding teacher explains better than your math teacher

ruiansucks
Автор

math.floor: rounds down chosen number into nearest integer

math.ceil: rounds up chosen number into nearest integer

math.huge: outputs the largest number possible

math.random: picks a random number between two chosen numbers inclusive

math.rad: converts angle value into radian value

math.deg: converts radian value into angle value

math.pi: outputs the value of pi

math.pow: outputs the chosen power of a chosen number

math.abs: outputs chosen value as if in a modulus (barely used)

unknownedleaf
Автор

Wow I used to think these math functions were hard AF. Gonna try these in the future... Thanks DevKing.

MichaelOnRBLXmore
Автор

This was so easy and simple thanks for existing😊🎉

minecraftlolguy
Автор

You learned me more than what my teacher Learned me in 5 hours

abdullahafzal
Автор

if you want to auto round then use this script i made

local num = 4.6 -- insert any integer and decimal point here
local check = math.floor(num + 0.5)
if check == math.floor(num + 1)
then
num = math.floor(num+1)
print(num)
else num = math.floor(num)
print(num)
end

BennydoesstuffYT
Автор

btw anyone wondering how to get random decimal numbers you do
while wait() do
local num = Random.new():NextNumber(numberhere, numberhere)
print(num)
end
BUT if you want to have it like an even nice decimal like 0.7 1.8 or 9.3 you would math.floor it and times it by 10 then take it to the power of etc to set your decimal amounts
heres an example
while wait() do
local num = Random.new():NextNumber(1, 8)
local decimalPlaces = 3
result =
print(result) -- first number was 2.716
end

masonpacentine
Автор

dev king thank you for being my math teacher

liaml-oh
Автор

OHHHH GOD! Imagine being stupid as me and using sub string over and over again and not knowing functionality of math.floor lol

SMC_Dev
Автор

people probably don't agree with math.rad() is basically what he's saying.

rockman
Автор

when I was watching this I was also doing a test on Integers

ClockWiseIsAGreatDeveloper
Автор

Is there small math
How do you turn the math.huge into one people possesing one GUI
Example :

Into only you having the GUI
And not everyone when you execute it on the console

boxman