I've struggled in the past with basic scripting concepts, whether it's because it's hard to pay attention or whatever it may be. I am able to speed up and slow down the videos and your speech is so incredibly consistent and clear that I can always understand what you're saying. All around really fantastic stuff, you have a real talent for explaining concepts just enough to the point where it's understandable without overexplaining or underexplaining. The only thing I think would increase my understanding (this may just be personal preference) is providing real-world/real-game examples (damage calculation, inventory, whatever it may be) of where parameters can come in handy and when it would make sense to apply different arguments to the same function parameters. Aside from that, just really perfect stuff, thanks a lot.
@cjstrong7056
2 ай бұрын
Agreed, Agreed, and Agreed
@Thefourdelinquents-q6b
Ай бұрын
Yeah like I wanna make games but it’s just hard for me to watch so much tutorials until I get it
@jfeondkthz
Ай бұрын
holy glaze 🙏
@VoltigarRBLX
Ай бұрын
@jfeondkthz pretty exclusively constructive feedback, but I guess in circles where there's exclusively insecure men you can't even compliment each other or give feedback without people reading it some kinda weird way
@Demonsinful
13 күн бұрын
@@VoltigarRBLX I mean he is kinda glazing the man
@OnePiece_Dimension
10 күн бұрын
Thank you BrawlDev for the Informativ Video this is what i have done for my Learning Objectiv! --MATH, PARAMETRES & RETURNS --RETURN local function Plus(Num1, Num2) local PlusSummen = Num1 + Num2 return PlusSummen end local Ergebnis = Plus(10, 5) print(Ergebnis) --PARAMETRES local function Minus(Num1, Num2) local MinusSummen = Num1 - Num2 print(MinusSummen) end Minus(5, 2) --MATH local Divison = 2 / 2 print(Divison) local Multiplikation = 2 * 2 print(Multiplikation)
@summeranan6969
2 ай бұрын
This coding series is actually helping me open up. I used countless different tutorials to try and learn, but they go way too fast, and not that specific. This tutorial is perfect. I love the way you go slow and steady, and you break everything deep so I can understand every single concept. Thank you!! +1 Sub
@Boop_your_nose
Ай бұрын
The script that I made. Thank you for the amazing tutorials! local function addition(number1, number2) local result = number1 + number2 return result end local printResult = addition(8, 2) -- This is for adding numbers print(printResult) local function subtraction(number1, number2) local result = number1 - number2 return result end local printResult = subtraction(8, 2) -- This is for subtracting numbers print(printResult) local function division(number1, number2) local result = number1 / number2 return result end local printResult = division(8, 2) -- This is for dividing numbers print(printResult) local function multiplication(number1, number2) local result = number1 * number2 return result end local printResult = multiplication(8, 2) -- This is for multiplying numbers print(printResult)
@fantomgaming1358
Ай бұрын
how is the script supposed to tell which printResult it should print when all their keynames are the same?
@Boop_your_nose
29 күн бұрын
@@fantomgaming1358 it prints them all regardless of the same name, although I should've changed the key name.
@fantomgaming1358
29 күн бұрын
@@Boop_your_nose yeah
@jacetheace55
20 күн бұрын
i made it so that if the print result is not equal to 4 it prints "AAAAAA" and if it is it just prints the result, which is 4 pretty useless tbh because there's really no point in printing the correct result because whatever you set the result to will always be equal to itself.
@faintvolley
29 күн бұрын
It's been slow for me so far, but I feel like I'm starting to really grasp it. This one def had me stumped a lot but I understand it now that I've simplified it for myself. local function addition(number1, number2) local result = number1 + number2 return result end local printResult = addition(8, 2) print(printResult) local function subtraction(number3, number4) local Result = number3 - number4 return Result end local Printresult = subtraction(8,5) print(Printresult) local function multiply(number5, number6) local answer = number5 * number6 return answer end local answerResult = multiply(5,5) print(answerResult)
@Emiwithlittlecreativity
7 күн бұрын
Guys i recommend writing down what you have learned in a (for example) notebook so that it can enter your brain more clearly and so that you can go back if u forgot
@sereneybeanie6733
5 күн бұрын
I was having a hard time with parameters and return statements for a while now and this helped me understand at least a little more so thank you! Here's what I did for the learning objective btw: local function subtraction(number1, number2) local result = number1 - number2 return result end local printSResult = subtraction(2, 1) print("Subtraction result: ", printSResult) local function multiplication(number1, number2) local result = number1 * number2 return result end local printMResult = multiplication(8, 2) print("Multiplication result: ", printMResult) local function division(number1, number2) local result = number1 / number2 return result end local printDResult = division(5, 2) print("Division result: ", printDResult)
@Blood-StrikeGamer
2 ай бұрын
This is truly amazing stuff, you explain it in such a simple way, thank you, I've been trying to find good videos and none of them explain anything, nearly as well as this one does.
@V4x07
22 күн бұрын
here's mine which i tried to do, first i tried: ''if hp < 1 then print('You died') end'' and it told me that i cant compare hp to a number because is a ''nil'', so i stood there in front of my screen, during like 10 mins thinking what to put, and i magically thought of replacing ''hp'' for ''hpLeft'', and it worked. Let me know if the script is okay, ik it most likely isnt the best option for a damage and hp system for a fighting game but im a beginner and i wanna know if i did good so far with this attempt, here's the script: local function critHit(hp, dmgtaken) local TotalDmg = hp - dmgtaken return TotalDmg end local hpLeft = critHit(50, 60) if hpLeft < 1 then print("You died") end
@Bananacease69
3 күн бұрын
wow nice, this is so cool
@Roman_play012
2 күн бұрын
it doesn't actually work, i copied to test and it showed me "you died" before even dying
@RSM_ONION
Ай бұрын
My interpretation of the return command local function addition(number1, number2) local result= number1 + number2 return (result) end local printResult = addition(8, 2) print (printResult) in this example number1=8 and number2=2 8+2=10 result=10 return result is basically just sending result back in place for the "addition(8,2) so local printResult = 10 therefore print (printResult) prints "10"
@daniel_denamit724
2 ай бұрын
i was a bit confused about the part with return but after rewatching it like 3 times i understood it more thanks for the video!
@korudo855
Ай бұрын
you think youd be able to elaborate it?
@ioproto6581
Ай бұрын
@@korudo855 Here's how I understood it myself; thinking about how we can use the value after we return it. A return is effectively keeping the end value, whereas printing is only telling the console what the value is. For example, if we had a function local function addTwo(X, Y) local result = X + Y print(result) end This is simply just adding two numbers like what the video demonstrated! Say we wanted to run this function twice and print the end result of adding two sets of numbers together. We cannot do a print(addTwo(1,1) + addTwo(2,2)), because we're asking it to add two numbers twice, but we haven't told it to keep the end values of those two individual addition executions we're asking it to do (we tell it to do 1+1, but then just output the result in the console with the 'print' command, and same for the 2+2). We've only told it to print the result. If we return the result, we are asking it to remember the end of the two individual executions of the function. In other words, with the print line above, we've asked it to add 1 + 1, and then print that value. Then, add 2 + 2, and print that value. But then we're asking it to add... what? We haven't asked it to remember that 1 + 1 = 2 and 2 + 2 = 4, so it cannot do what we would expect (2 + 4). Instead, if our addTwo function was this local function addTwo(X, Y) local result = X + Y return result end Now, because of the return, we're asking it to remember its end result upon every execution. So now we can do our print(addTwo(1,1) + addTwo(2,2)) Because now we're telling it to print the end result of (1+1) PLUS (2+2), and it will print 6 as the output in the chat. If this doesn't make sense let me know and I can try to reclarify.
@BruhEditsFr
Ай бұрын
@@korudo855 Basically return is returning values. For example: I give 5$ for a burger in return I get a burger. Read this 4 times and u should get it.
@questionmarkdude4910
7 күн бұрын
i understood pretty quick and the explaination is simple!!! here's my script local function addition(num1, num2) local result = num1 + num2 return result end local function subtraction(num3, num4) local result1 = num3 - num4 return result1 end local function multiplying(num5, num6, num7) local result2 = num5 * num6 * num7 return result2 end local printResult = addition(8, 2) print(printResult) local printResult1 = subtraction(5, 2) print(printResult1) local printResult2 = multiplying(2, 4, 3) print(printResult2)
@basedconform
3 ай бұрын
local function addition(number1, number2) local result = number1 + number2 -- creates a result of the addition of two functions print(result) -- prints out the result end addition(5, 2) -- the difference between arguments and parameters is: parameters are used to create variables, arguments are what values we throw into the function addition(5, 2) addition(4, 3) local function additionv2(number1, number2) local result = number1 + number2 return result end local printResult = additionv2(8, 2) print(printResult) -- return can also be used to exit out of functions, which means that it can end the function at whatever line it is called. local function subtraction(number1, number2) local result = number1 - number2 print(result) end subtraction(3, 2) local function division(number1, number2) local result = number1 / number2 print(result) end division(2, 2)
@polegamerstv7035
2 ай бұрын
TYSM you just saved me 13 mins!
@pinkdude4602
2 ай бұрын
@@polegamerstv7035 No he didnt, just having that script isnt gonna help you learn anything.
@aMysterious1rblx
2 ай бұрын
we have the same profile picture
@EdwardEnglish-j2h
2 ай бұрын
*head banging on desk* *gets concussion* My brain: thATs WhaT i hAVe tO dOoooOOoooooo? I DONT WANNA Proceeds to get brain damage
@polegamerstv7035
2 ай бұрын
@@pinkdude4602 no he did? I already know like 2 coding languages the only thing i need to know is the words here to use it i know functions and other things im just watching to make sure
@RobloxClipShorts
8 күн бұрын
I'm already here and I've learned more than anyone has every told & taught me. Thank you so much for the tutorials!
@zoid_ws1226
2 ай бұрын
I see that python and luau are very similar in some aspects so I was able to understand most of the video before you explained it. Still very good explained video! Anyway here is the code I learnt from this epsioide! local function addition(x,y) local result = x + y return result end local printresult = addition(5,4) print(printresult) local function Minus(x,y) local result = x - y return result end local result2 = Minus(10,9) print(result2) local function Multipication(x,y,z) local result = x * y * z return result end local result3 = Multipication(20,10,3) print(result3) local function Division(x,y) local result = x / y return result end local result4 = Division(100,10) print(result4) local function bidmass(w,x,y,z) local result = w + x / y * z return result end local result5 = bidmass(10,20,400,5) print(result5)
@Sk_lled
Ай бұрын
Yeah, I'm just starting this and I've done basic python and know most of this
@milolokk6274
23 күн бұрын
ive tried leaning many coding languages and ive never understood what a return statement was in any of them thank you for explaining really well these are prob the best coding tuts out there function opacity(x,y) baseplate.Transparency = 0.5 wait(1) baseplate.Transparency = 0 wait(1) baseplate.Transparency = 0.5 wait(1) baseplate.Transparency = 1 print(x, y) end i finally understand what a return statement does edit( ) an idea i had with this local function health(health,damage) local res = health - damage return res end local takendamage = health(100,45) print(takendamage) can be used for damage being taken in by a character i dont know if theres a more simple way but this is how i saw it
@vvkiivv
Ай бұрын
local function addition(number1, number2) local result = number1 + number2 return result end local printResult1 = addition(8, 2) print(printResult1) local function subtraction (number1, number2) local result = number1 - number2 return result end local printResult2 = subtraction(10, 5) print(printResult2) local function multiplication(number1, number2) local result = number1 * number2 return result end local printResult3 = multiplication(10, 10) print(printResult3) local function division(number1, number2) local result = number1 / number2 return result end local printResult4 = division(1000, 100) print(printResult4) Your tutorials are really helpful and you explain them really well thanks
@ump7732
2 ай бұрын
Thank you for making these, it has made learning scripting easier local function addition(n1, n2) local result = n1 + n2 print(result) return result end local printresult = addition(6, 9) print(printresult) local function subtraction(n3, n4) local result2 = n3 - n4 print(result2) return result2 end subtraction(5, 5)
@Lejor
Ай бұрын
this video was great but i needed my dad to explain what returns were cause prob just for me i didnt know what it was i just knew that it did smt like when i was using returns i didnt understand it took a lot of raging to understand this lol (but thats prob just for me) but dont be sad if you somehow see this because i have spent money on trying to learn but you are showing people how to do it in an understandable way the only thing i can say that is bad is that u get ahead of me while i type but thats not a big problem cause everyone can just pause
@ChipiChipiKAYRA
Ай бұрын
Thanks :D I will do special thanks you in my experience :D
@soyyoluca5248
20 күн бұрын
local function velocity(distance, time) local result = distance * time return result end print(velocity(4, 10)) a little something i remembered from physics class. thanks for the class!
@osakadev
3 ай бұрын
List of math operators (if you want these): Substraction: - Addition: + Multiplication: * Division: / Power: ^ ( same as doing math.pow(x, y) ) Scientific notation: 10e4 (or any number, an "e" and any number) Floor division: // ( the same as doing math.floor(x / y) ) Modulus: % I dont know if I miss another one
@BedwarsRBLX
3 ай бұрын
Modulus
@osakadev
3 ай бұрын
@@BedwarsRBLX true
@s1nblitz
3 ай бұрын
+= and -= are also operators too they can be used for taking damage so instead of doing like health = health - 20 you can just do health -= 20
@osakadev
3 ай бұрын
@@s1nblitz Those are compound operators, not math operators, I'm talking about math operators
@CrackedUpEgg
2 ай бұрын
mine: rad (radius i think) pi circumference sin square root ratio abs (absolute) (Length from zero) cosine round >.
@rensuakatimechi
6 күн бұрын
local function addition(number1, number2) local result = number1 + number2 return result --What does return do? So return is the results of the caculations we made back to where we called the function end -- we can create a variable to attach to the function so we can take the value and print it ourselves out side of the function local printResult = addition(8, 2) -- once the two numbers or values are added it restuns the results back into our own statement print(printResult)-- we created a variable out side and set the sequal = values to addition with the 2 numbers then the two numbers are added then then return brought back the results to printResults --"return" can also be use to exit out of functions, which means that it can end the function whenever the line it is called and the rest of the function will NOT run
@Guest_Apex
2 ай бұрын
great video! local function subtraction (letter1, letter2) local result = letter1 - letter2 return result end local printResult = subtraction(4, 3) print(printResult)
@RawPidgeonYummy
Ай бұрын
local function addition(number1, number2) local result = number1 + number2 return result end local result = addition(0.1, 0.8) local transparencyVariable = result game.Workspace.Baseplate.Transparency = result made my baseplate change transparency with using the math! guide was very informal and easy to understand thank you.
@zephyr_playz2535
2 ай бұрын
I am a bit confused so I will try to practice these first 7 episodes before moving on! Thanks for all of the help though, this is such a lifesaver.
@vishwakarmakaushal259
29 күн бұрын
local function addition(num1, num2, num3) local result = num1 * num1 * num3 return result end local x = addition(3.14, 2, 2) print("A circle has radius 2cm find area of circle") print("answer is :") print(x)
@vmc-mal
2 ай бұрын
Another decent one, here's my learning objective. --No Return local function calcButOnlyAddition(num1, num2) local result = num1 + num2 print(result) end calcButOnlyAddition(100, 100) calcButOnlyAddition(37, 32) --WithReturn local function calcButWithAdditionAndResult(num1, num2) local result = num1 + num2 return result end local result = calcButWithAdditionAndResult(37, 32) print(result) local result = calcButWithAdditionAndResult(100, 100) print(result)
@barry0_0
16 күн бұрын
What i made: local function division(num1, num2, num3) local result = num1 / num2 - num3 return result end local x = division(8, 5, 5) local function adittion(num1, num2, num3, num4) local result = num1 + num2 /num3 * num4 return result end local y = adittion(5, 9, 6, 34) print(y + x)
@srcgisrealwow
Ай бұрын
local function addition(num1, num2, num3, num4, num5) local result = num1 * num2 * num3 * num4 * num5 return result end local printResult = addition(8, 4, 10, 56, 701) print(printResult) ur the best man keep up the good work!!
@Freaky_KJ.1
12 күн бұрын
This is what i made. Thx for ur Amazing tuts! local function addition (Pizza1, Pizza2, Money) local result = Pizza1 + Pizza2 - Money return result end local MoneyLeft = addition(5, 5, 28) print(MoneyLeft)
@Sof_Holl
2 ай бұрын
the start: local addition = 2 + 4 print(addition) local addition2 = 2 * 4 print(addition2) local adddition3 = 4 / 2 print(adddition3) the end: local function addition(number1, number2) local result = number1 * number2 return result end local printResult = addition(8, 2) print(printResult) local function addition(number1, number2) local result = number1 - number2 return result end local printResult = addition(8, 2) print(printResult) local function addition(number1, number2) local result = number1 / number2 return result end local printResult = addition(8, 2) print(printResult) tysm :)
@Timuçinn1
2 ай бұрын
local function addition(burger1, burger2) local price = burger1 + burger2 return price end local printprice = addition(3.99, 5.99) print(printprice) 2 burger price is 9.98
@IAmALime
2 ай бұрын
local RP = game.Workspace.RedPart local function sigma() RP.Transparency = 0.5 end sigma() sigma() i repeated this with a couple other things such as anchoring and materials :D loved the video!
@EugescoJuve10
22 күн бұрын
local function maths(n1, n2, n3) local result = n1 + n2 * n3 print(result) end maths(7, 10, 29) Wanted to keep it easy, love your videos!
@user.from.2006
Ай бұрын
i have always loved scripting , i started with java , but i didnt see a future with making games in java. java compared to this is super super complicated , i didnt really belive how simple luau actually is. to be honest i think i had a really big advantage from other people starting with luau since some things are semmilar to java , like funktions and variables. i was always really confused by other youtube videos , since they put stuff that is absolutly not for beginners. i love how you explain pretty much everything , even how to rename the scripts and how to add them every single time xD. Love your videos , dont stop! :]
@SplashionRBX
Ай бұрын
you're making this so easy to understand! thank u!
@SimplyTutuco
13 күн бұрын
This is really interesting, but a little confusing. *For what I understood, the return command stores the result of whatever is the function for it to be used again without it having to call the function and calculate it all again. If I'm wrong, please correct me.* Here's what I did for the LO: local function solveSequence(n1, n2, n3, n4, n5) local sequenceResult = n1 * n2 - n3 - n4 + n5 return sequenceResult end local SResult = solveSequence(3, 7, 9, 5, 2) print(SResult) local function epicFunction(epicness, awesomeness) local coolness = epicness + awesomeness return coolness end local totalCoolness = epicFunction(3910, 4927) print(totalCoolness) I understood math, parameters and arguments but somehow couldn't understand returns that well.
@Demonsinful
13 күн бұрын
Wdym ,It returns the local function I think you need a dictionary it's literally straight forward.
@LaufzDS
Ай бұрын
great videos, i learnt alot and still learning!
@Life_of_Boredom
Ай бұрын
If anyone is still confused on what the return statement is, it’s essentially telling the next line to follow the same perameters and functions (or in a way returning the parameters and functions) which allows him to do a new variable and still have it do the calculations without having to lay out the parameters and telling it how to calculate the numbers again, it’s more of a neat organizing thing which will help your code stay organized. (This is how I interpreted it, someone please correct me if I am wrong.)
@prozabdielzoo3212
Ай бұрын
Omg you just saved me another 1 or 2 days trying to figure this out ty!!!
@Capy5687
Ай бұрын
It took all of my braincells to understand this concept
@IDK_WTI
27 күн бұрын
the next line is "end"
@liviii4188
22 күн бұрын
so the return statement lets you use the result of a function elsewhere in your code without repeating the calculations?
@Contemptical
13 күн бұрын
i thnk what it does is return tells the function to use the values given without needed to be told if its adding, subtracting etc
@Localally
2 ай бұрын
local function PEMDAS(num1, num2, num3, num4, num5) local Sum = num1 + num2 * num3 - num4 / num5 return Sum end local PrintSum = PEMDAS(5, 5, 2, 4, 2) print(PrintSum) end something small and loving the series so far, easy to understand, and well paced
@calluss1
Ай бұрын
Thanks again, here's the script I made, i know its not much but i tried local function subtraction(number1, number2, number3) local result = number1 - number2 - number3 return result end local printResult = subtraction(100, 50, 25) print(printResult) Outcome = 25
@Dazentz
Ай бұрын
thanks bro local function subtraction(number1, number2) local result = number1 - number2 return result end local printresult = subtraction(5, 9) print(printresult)
@mr.chromo
Ай бұрын
This one definitly slowed me down a bit, and while I'm left a little confused I was able to replicate it first try with subtraction...now...for the notes ()()()()() NOTES ()()()()() 1 local addition = 2+2 2 print + (addition) ________________________ That should print out 4 in the output ________________________ 1 local function addition(number1, number2) 2 local result = number1 + number 2 3 print (result) 4 end 5 6 addition (5, 2) _________________________________________ That should output 7 _________________________________________ Return _________________________________________ 1 local function addition (number1, number2) 2 local result = number1+ number2 3 return result 4 end 5 6 local printResult = addition (8, 2) 7 print (printResult) ---------------------------------------------------------------- Learning objective: Make more functions for things like subtraction and division ----------------------------------------------------------------- Attempt _______________________________________ local function subtraction(number1, number2) local result = number1 - number2 return result end local printResult = subtraction(8, 4) print(printResult)
@cakeobear
2 ай бұрын
Can someone help me with Returns? I don't understand what they are meant to mean, and I watched the video and I am still confused, can anybody explain it to me please?
@WaldenDexaus
Ай бұрын
I searched on the dev forum and it says that returns can stop or give back value after calling the function
@Nex_Devs
Ай бұрын
i can help you, so a return just makes makes the thing return to the function, and you need to use a variable outside of the function to extract it
@cakeobear
Ай бұрын
@@Nex_Devs tysm
@mopmopmoo7671
Ай бұрын
@@Nex_Devs Pls tell me what “the thing” is I still don't understand ur explanation
@JesseMinecraft_
Ай бұрын
@@Nex_Devs Clarification (for myself): In order to actually get a result as a variable from a function you need to use a return. The return is essentially the "finished product" of the function? And from there you can set a variable to that return and extract said finished product?
@Yoyo01232
Ай бұрын
I made a script with subtraction and addition. local function addition(number1, number2) local result = number1 + number2 return(result) end local printResult = addition(87, 13) print(printResult) local function Subtraction(number1, number2) local result = number1 - number2 return(result) end local pR2 = Subtraction(17, 6) print(pR2)
@eclipse00992
Ай бұрын
local function subtraction(num1, num2, num3) local realResult = num1 - num2 - num3 return realResult end local printResult = subtraction(10, 5, 3) print(printResult) wonderful episode!
@StudioScriptBuilders-fb9bu
2 күн бұрын
This is what I've made (btw, this tutorial has so helped me be able to get better at coding and has really motivated me to keep learning! local function taxCalc(price) local tax = price * 0.1 return tax end
@euloveplayz6102
2 ай бұрын
Thank you so much! I've been struggling with return statements
@qw0lzz418
2 күн бұрын
--confused little bit but i will return and try to understand again later local function matam(naga1, naga2) local result = naga1 + naga2 return result end local printResult = matam(8, 2) print(printResult)
@Inveist
8 күн бұрын
as someone who has programmed before I know the majority of the things you say already even though I've never programmed in Lua but I watch this so you can get more money. You're welcome. (and I can never get to much practice)
@billtimmy-p4g
15 күн бұрын
local function addition(number1,number2) local result1 = number1 + number2 return result1 end local printresult1 = addition(2,9)--result 1 is turned into a variable with a function when u use return on it local function subtration(printresult1,num2) local result2 = printresult1 - num2 return result2 end local finalresult = subtration(printresult1,10) print(finalresult)-- using that same variable I used it as a secondary number for result 2
@babosaofficial
3 ай бұрын
exited to see how you explain tables!
@VersatileMC
2 ай бұрын
So for the Learning Objective i tried to recall all of the things i have learned in this playlist of Roblox Beginners Scripting into one program and it turned out quite cool! Here's my Work local part = game.Workspace.Part local function customSizeAndVolume(x, y, z) part.Size = Vector3.new(x, y, z) part.Material = "CrackedLava" part.BrickColor = BrickColor.new("Neon orange") local volume = x * y * z print("The volume of part is") print(volume) end customSizeAndVolume(10,10,10)
@JohnmichaelYlaya-k9v
Ай бұрын
I rewatch your video cuz I learned every concept of the playlist but never doing it so I decided to rewatch it and code what I learned so I never confused, so if you are new on this playlist start code not just watching just do it cuz its my biggest regret. local function adition(number1, number2) local result = number1 + number2 return result end local printResult = adition(10, 10) print(printResult) local function subtraction(number1, number2) local result = number1 - number2 return result end local printResult = subtraction(20, 5) print(printResult) local function multiplication(number1, number2) local Result = number1 * number2 return Result end local printResult = multiplication(5, 5) print(printResult) local function division(num1, num2) local result = num1 / num2 return result end local printResult = division(100, 2) print(printResult)
2 ай бұрын
local function addition(number1, number2) -- Paremeter is basically a variable we only define when calling the function. local result = number1 + number2 return result -- Return is returning whatever the result was too where the function was called, can also stop executions in functions. end local printResult = addition(8, 2) print(printResult) local function substraction(number1, number2) local result = number1 - number2 return result end local printResult = substraction(6, 3) print(printResult)
@aiwam.
27 күн бұрын
I've tried scripting before but didnt pay attention properly and only copied it. This time i actually learned and made a decent script for the end goal. here it is local function division(number1, number2, number3) local skibidi = number1 / number2 + number3 return skibidi end local skibidiResult = division(360, 4, 10) print(skibidiResult)
@Random-nc9xs
21 күн бұрын
"local skibidi"💀
@GoofySillyGuy
22 күн бұрын
i made this code where basically you have 2 parts, and it tells you the locations of them in relation to each other and then if part1's x position is more than 0 it turns part 2 red, so here it is: local part1 = game.Workspace.Part local part2 = game.Workspace.Part2 local function addition(part1, part2) local result = part1 - part2 return result end addition(part1.Position, part2.Position) if part1.Position.X > 0 then part2.BrickColor = "Really Red" end local printresult = addition(part1.Position, part2.Position) print(printresult)
@that-original-channel
15 күн бұрын
Your the best heres what I made! local function addition(x, y) local result = x + y return result end local function subtraction(x, y) local result = x - y return result end local function multiplication(x, y) local result = x * y return result end local function division(x, y) local result = x / y return result end
@mrfloaties991
14 күн бұрын
-- Math Functions local a = math.random(1,10) local b = math.random(1,10) local function addition(num1, num2) local result = num1 + num2 return result -- sets the item to the value end local printResult = addition(a, b) print(printResult)
@cookiecutter5176
11 күн бұрын
Aha! I coded it so the results of two equations got plugged into a multiplication equation! And it worked! I’m learning :D
@navs_svan
Ай бұрын
-- ADDITION local function addition(number1, number2, number3) -- Calling function and adding parameters local result = number1 + number2 + number3 -- Create variable to add the parameters return result -- Return the result back into the function end local AdditionResult = addition (3, 2, 5) -- Variable to call the function and add the parameters print (AdditionResult) -- Print the final result -- SUBTRACTION local function subtraction(number1, number2) local resultTwo = number1 - number2 return resultTwo end local SubtractionResult = subtraction(10, 5) print(SubtractionResult) -- MULTIPLICATION local function multiplication (number1, number2, number3) local resultThree = number1 * number2 * number3 return resultThree end local multiplicationResult = multiplication (3, 3, 3) print(multiplicationResult) -- DIVISION local function division(number1, number2) local resultFour = number1 / number2 return resultFour end local divisionResult = division(100, 10) print(divisionResult)
@shajidhossain9361
Ай бұрын
Yo I was just gonna say this map concept is really cool and all these concepts are sick. But I was just gonna ask of what the practical use for math would be inside of our scripts?
@erloMak
2 ай бұрын
bro u are the best i never understood other youtubers but u explain it perfectly
@HackerDude12
Күн бұрын
what i did: -- this adds the 2 numbers local function addition(num1, num2) local result = num1 + num2 return result end -- gets the result and prints it local PrintResult = addition(8, 3) print(PrintResult) -- subtract 2 numbers local function subtraction(num1, num2) local result = num1 - num2 return result end -- prints the result local PrintSub = subtraction(43, 6) print(PrintSub) -- mutiplies 2 numbers local function multiplication(num1, num2) local result = num1 * num2 return result end -- prints the result local PrintMulti = multiplication(6, 5) print(PrintMulti) -- divides 2 numbers local function division(num1, num2) local result = num1 / num2 return result end -- prints the result local PrintDivision = division(30, 6) print(PrintDivision)
@OfficialF0rced_
2 ай бұрын
You can do like a simple add, sub, mul and div, you can do this: local function add(num1 + num2) local result = num1 + num2 print(result) end And so on...
@zylff
2 ай бұрын
Thank you for this I appreciate it!
@Demonsinful
13 күн бұрын
For anyone reading this, it took me only one second to fully understand what "return" does once he mentioned it. If you can't grasp such a basic concept, I don't think your frontal cortex is fully developed yet. Just remember, if you want to make software engineering a career, you have to practice every day, or y'all fall behind.
@the-guy1.0
Ай бұрын
i changed everything to subtraction, thx for the videos they are verry helpfull
@legoessa
2 ай бұрын
very good video heres what i made if interested local function addition(num1, num2) local result = num1 + num2 return result end local printResult = addition(43, 7) print(printResult) local PrintResult2 = addition(53, 7) print(PrintResult2) local function multiply(num1, num2) local result = num1 * num2 print(result) end multiply(5, 2) multiply(9, 10) local function multiDivide(num1, num2, num3) local result = num1 * num2 / num3 print(result) end multiDivide(5, 10, 2) multiDivide(10, 50, 4) local function subtract(num1, num2, num3) local result = num1 - num2 print(result) end subtract(4, 1) subtract(7, 3)
@eljaitor8558
Ай бұрын
that's adds all of the things that learm in the video ;) local function addition (number1, number2) local resultAddition = number1 + number2 return resultAddition end local printresultaddition = addition(2, 1) --for example print(printresultaddition) local function multiplication (number1, number2) local resultmultiplication = number1 * number2 print(resultmultiplication) end multiplication(2, 1)
@GaijenParadox
Ай бұрын
The Return statement kinda got me confused on its use but I figured it out by interpreting the function as a power plant, with the return statement you send off the power to where it being called and you can use it for different things, printing etc. hope this helps anyone else confused
@jellyioup
28 күн бұрын
So it returns it to the part of the code thats being called and can be used outside of just printing? I'm so confused lol
@personnnnnnnnnnnnnnnnnnnnnnn
Ай бұрын
local function addition(number1, number2, number3, number4) local result = number1 + number2 * number3 / number4 return result end local printResult = addition(8, 2, 2, 2) print(printResult) hey your tuts help a ton and 2 things that i would recommend are one try not to say "uh" a lot and two don't delete stuff you make just make a new script and name it (whatever the subject is)2 or just go down or press enter
@ozozlmao
Ай бұрын
local function practicapara(num1, num2, num3, num4) local multi = num1 * num2 -- Multiplies number 1 and number 2 local suma = num2 + num3 -- Sums number 2 and number 3 local sub = num4 - num2 -- Substracts number 4 minus number 2 local res = multi + suma + sub -- Sums the 3 variables return res --Returns the result of the 3 variables added end local resultado = print(practicapara(5, 2, 6, 8)) -- Equals 24
@FrostyAzure
2 ай бұрын
I think local makes it so the variable only exist in that specific script and global makes it so that the variable exists in every script, am i right?
@marwanatta
16 күн бұрын
Your explanation is fantastic, but I couldn't understand what is the return statement. Is it an alternative to the print statements? and also if I use it in a function and then write a bunch of lines in the same function under it, they won't run will they? pls answer my question cause I think I wouldn't be able to go further like that
@MR.Risindu
2 ай бұрын
local function subtraction(number1, number2) local result = number1 - number2 return result end local printResult = subtraction(10, 8) print(printResult)
@goodnoob857
2 ай бұрын
You explain very well, thanks you so much
@Ecaw
Ай бұрын
My work: -- PERAMETERS -- --The difference between arguemntts and parameters is what we use to create our variables inside our functions. local function addition(number1, number2) --MUST be seperatted with a comma and a space :D local result = number1 + number2 return result --Reurns to printResult to give the answer end --Return can also be used to exit out of functions, which means that it can end the function at whatever line it is called and the rest of the function will not run. local printResult = addition(8,2) --Feeds back into stated function print(printResult) local function Math(number1, number2) --MUST be seperated with a comma and a space :D local result = number1 + number2 print(result) end Math(5, 2) --NOT RESTRICTED TO NUMBERS! Can be ("string", "string") or ("Boolian(True)", "Boolian(False)") Math(3, 2) Math(9, 2) -- Because number1 and number2 are placeholders, we are not restricted to the same value. Possibly useful for leaderboards and calculating rewards.
@StarLights_gtag
2 ай бұрын
local function loly(n1, n2, n3) local doll = n1 + n2 - n3 return doll end local lolypop = loly(2, 8 , 9) print(lolypop) this is so cool
@ParadoxFlameOfficial
2 ай бұрын
local function Addtions(Number1, Number2) --paramertas local result = Number1 +Number2 print(result) end Addtions(5, 7)-- argument Addtions(7, 1) Addtions(3,4) local function Multiplication(Number1, Number2, Number3) local result = Number1 + Number2 * Number3 return result end local PrintResult = Multiplication(5, 2, 7) print(PrintResult) 😁
@IceyDude1
Ай бұрын
it is easy for me to follow along with your guide but the thing is that i keep forgetting, so what i want to tell everyone who also forgets is to just keep doing more learning objectives
@Khr0maEffect
Ай бұрын
local function multiplication(int1, int2, int3) ("int" as in "Integer") local result = int1 * int2 * int3 return result end multiplication(7, 8, 3) local multResult = multiplication(12, 9, 7) print(multResult + 73) This prints the number 829
@KawnerEdwin1
Ай бұрын
local function sub(n1, n2, n3) local result = n1 * n2 / n3 print(result) end sub(4, 3, 2) thanks!
@KingOfManFace
Ай бұрын
i did: local function addition(number1, number2, number3, number4) local result = (number1 - number2) * number3 + number4 return result end local printresult = addition(8, 2, 2, 5) print(printresult)
@CraftedConnections
2 ай бұрын
0:28 little Timmy : aw! I can’t make my super cool lighting McQueen obby anymore😢😢😢 I don’t know Aditwon!
@bloblets
4 күн бұрын
rip lil noobert
@IceyDude1
Ай бұрын
i like how you just give us homework but instead of it being really boring you make it feel like i want to do it! Just wanted to point that out😅
@TarekTRBW
Ай бұрын
Agree
@TarekTRBW
Ай бұрын
Attractive homework bro needs to be teacher
@Meanfella
2 ай бұрын
heres what i did! i stopped for a day but im back on my scripting grind, btwdo i always have to use returns when i do something like this? local function add(number1, number2, number3) local result = number1 + number2 + number3 return result end local printresult = add(50, 45, 10) print(printresult) local function sub(number1, number2) local result = number1 - number2 return result end local printresult = sub(12, 2) print(printresult) local function mul(number1, number2) local result = number1 * number2 return result end local printresult = mul(5, 10) print(printresult) local function div(number1, number2) local result = number1 / number2 return result end local printresult = div(10, 2) print(printresult)
@HarryMalone-y1v
Күн бұрын
i just added some more local printresult = addition(5, 8) print(printresult) local function addition2(number1, number2, number3) local result = number1 + number2 - number3 return result end local printresult = addition2(5, 8, 9) print(printresult) local function addition3(number1, number2, number3, number4) local result = number1 * number2 - number3 / number4 return result end local printresult = addition3(5, 8, 20, 5) print(printresult)
@fascinatingfaux811
2 ай бұрын
local function subtraction(n1, n2) local result = n1 - n2 return result end local printanswer = subtraction(5, 3) print(printanswer)
@aname9186
3 күн бұрын
--Addition local function add(num1, num2) local result = num1 + num2 return result end local prntresult = add(5,30) print("Addition =" , prntresult) --Multiple local function multi(num1, num2, num3, num4) local answer = num1 + num3 - num2 * num4 return answer end local multianswer = multi(5, 3, 10, -4) print("Multiple =" , multianswer) --Subtraction local function subtract(num1, num2) local eto = num2 - num1 return eto end local sandwich = subtract(92, 74) print("Subtraction =" , sandwich) --Division local function divide(num1, num2) local div = num1 / num2 return div end local sandhamwich = divide(3, 10) print("Division =" , sandhamwich)
@imlikesomethingidk8827
3 ай бұрын
local function addition(numb1,numb2,operator,numb3) if operator == 1 then return numb1 + numb2 * numb3 -- Numb 3 can be left as one else return numb1 - numb2 / numb3 end end local printnresult = addition(10,20,1,1) print(printnresult, " And BrawlDev is awesome!") I have learned a bit of coding but forgot the more advance one, so yeah :/
@dabacon6263
Ай бұрын
here is what i did! local function division(n1, n2) local result = n1 / n2 return result end local chicken = division(32, 8) print(chicken)
@birthdayboyplayz
2 ай бұрын
local function division(number1, number2, number3, number4) local result = number1 / number2 + number3 * number4 print(result) end -- Call the division function with the correct syntax division(6, 3, 4, 9)
@Keagan_Pow
3 ай бұрын
Think of it as the way a function gives an answer to the question it was asked.
@Aetherinz
3 ай бұрын
-- Operation Functions local function add(num1,num2) local sum = num1+num2 print(sum) end local function subtract(num1,num2) local difference = num1-num2 print(difference) end local function divide(num1,num2) local quotient = num1/num2 print(quotient) end local function multiply(num1,num2) local product = num1*num2 print(product) end -- Return Function local function addReturn(num1, num2) local returnSum = num1+num2 print(returnSum) return returnSum end addReturn(1,2) local returnedAdd = addReturn(2,4) print("↑ Return Function ↑") -- Print add(15,3) subtract(15,3) divide(15,3) multiply(15,3)
@SimplyKoolCreations
2 ай бұрын
local function printLearner()- function for printing print("Learner") -get the result end -helps to initialize printLearner() to give final result local function addition(num1, num2) local result = num1 + num2 print(result) end addition(1,2) local function addition(n1, n2) local result = n1 + n2 return result end local finalans = addition(4,3) print(finalans)
@ridwxxn
18 күн бұрын
-- Math -- Basics local function addition (number1, number2) local result = number1 + number2 print(result) end addition(5, 2) addition(3, 1) addition(12, 3) -- Addition: local function addition(number1, number2) local result = number1 + number2 return result end local printresult = addition(13, 2) print(printresult) -- Subtraction: local function subtraction(number1, number2) local result2 = number1 - number2 return result2 end local printresult2 = subtraction(2, 1) print(printresult2) -- multiplication: local function multiplication(number1, number2) local result3 = number1 * number2 return result3 end local printresult3 = multiplication(6, 5) print(printresult3) -- Division: local function division(number1, number2) local result4 = number1 / number2 return result4 end local printresult4 = division(12, 2) print(printresult4) print("tysm bro u taught me so much")
@Lab_Potato
9 күн бұрын
-- subraction local function subtraction(n1, n2) local result = n1 - n2 return result end local printResult = subtraction(8, 4) print(printResult) -- multiplication local function multiply(n1, n2) local result = n1 * n2 return result end local printResult1 = multiply(2, 2) print(printResult1) -- add both results print(printResult+printResult1)
@tetranomic4504
15 күн бұрын
local function subtraction(number1, number2, number3) local result = number1 - number2 - number3 return result end local printResult = subtraction(4, 5 ,8) print(printResult)
Пікірлер: 485