Parameters, Math, & Returns - Roblox Beginners Scripting Tutorial #7 (2024)

  Рет қаралды 82,511

BrawlDev

BrawlDev

Күн бұрын

Пікірлер: 969
@VoltigarRBLX
@VoltigarRBLX 4 ай бұрын
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
@cjstrong7056 4 ай бұрын
Agreed, Agreed, and Agreed
@Thefourdelinquents-q6b
@Thefourdelinquents-q6b 4 ай бұрын
Yeah like I wanna make games but it’s just hard for me to watch so much tutorials until I get it
@jfeondkthz
@jfeondkthz 3 ай бұрын
holy glaze 🙏
@VoltigarRBLX
@VoltigarRBLX 3 ай бұрын
@jfeondkthz pretty exclusively constructive feedback, but I guess in circles where there's only insecure men you can't even compliment each other or give feedback without people reading it some kinda weird way
@Demonsinful
@Demonsinful 2 ай бұрын
​@@VoltigarRBLX I mean he is kinda glazing the man
@TheNewBeh564
@TheNewBeh564 Ай бұрын
Please don't stop with this series even though your not getting as much views, its grateful to me and to some other people, you've been explaining it perfectly to me and im learning faster than I thought I would! Anyways, some code I made from this video: local function addition(number1, number2) local result = number1 + number2 return result end local printResult = addition(8, 2 ) print(printResult) local function subtraction(number144, number4) local result = number144 - number4 return result end local printResult = subtraction(144, 4 ) print(printResult) local function multiplication(number12, number12) local result = number12 * number12 return result end local printResult = multiplication(12, 12) print(printResult) local function division(number36, number6) local result = number36 / number6 return result end local printResult = division(36, 6) print(printResult) 😅
@summeranan6969
@summeranan6969 4 ай бұрын
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
@jun-dq9bt
@jun-dq9bt Ай бұрын
Return part was confusing asf for me and i believe for some people too but now that i understand it heres a easy way to understanding. For instance, we have local function addition (a, b) local result = a + b return result end local printResult = addition(8,2) print(printResult) If we translate this into english, its like saying "Hey Roblox, when i ask for the result for a + b, you calculate the result and RETURN to me that value. In this scenario, a = 8 and b = 2, find the result of 8 + 2 then RETURN to me that value" So in output you gonna see 10. return : exit a function and pass back a value to the caller.
@Qvikzz
@Qvikzz 29 күн бұрын
whats the difference in saying print(result) then saying return resul
@thecoalcub6012
@thecoalcub6012 20 күн бұрын
@@QvikzzI'm not an expert scripter or anything but I believe difference is that if you don't return the function it doesn't actually pass a value back to the caller. It's basically the difference between you telling someone a command to do something vs asking that someone a question and getting an answer to it.
@Suiiro
@Suiiro 14 күн бұрын
@@Qvikzzall printing the result is doing is just printing it into the output (console) for the dev to see, it doesn’t do anything for the game whatsoever. Returning though actually does something with the script itself and its not just visual
@DavidTheApex
@DavidTheApex 13 күн бұрын
your a cool man i just wanna mention that ty so much for this comment
@cutesy2282
@cutesy2282 3 күн бұрын
@@Suiirowhat’s it doing to the game?
@vali0us
@vali0us 2 ай бұрын
After doing python in school I've realised that python and lua have a lot of similarities and I'm enjoying learning a new programming language thanks for this video.
@fangyongsun7182
@fangyongsun7182 11 күн бұрын
lua is like python + javascript
@Kirikaze9
@Kirikaze9 19 күн бұрын
RIP to all my good ones watching in kindergarten that still haven't learned basic math
@mayineverfalter
@mayineverfalter 6 ай бұрын
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
@polegamerstv7035 5 ай бұрын
TYSM you just saved me 13 mins!
@pinkofthedude
@pinkofthedude 4 ай бұрын
@@polegamerstv7035 No he didnt, just having that script isnt gonna help you learn anything.
@aMysterious1rblx
@aMysterious1rblx 4 ай бұрын
we have the same profile picture
@EdwardEnglish-j2h
@EdwardEnglish-j2h 4 ай бұрын
*head banging on desk* *gets concussion* My brain: thATs WhaT i hAVe tO dOoooOOoooooo? I DONT WANNA Proceeds to get brain damage
@polegamerstv7035
@polegamerstv7035 4 ай бұрын
@@pinkofthedude 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
@OnePiece_Dimension
@OnePiece_Dimension 2 ай бұрын
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)
@AEROMAX
@AEROMAX 2 ай бұрын
I love how this isn’t even confusing to me anymore after this video
@HunterMankee-w1z
@HunterMankee-w1z Ай бұрын
@@AEROMAX same 😭
@RSM_ONION
@RSM_ONION 3 ай бұрын
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"
@Michael-sg2ek
@Michael-sg2ek 6 күн бұрын
could u help me if u still remember how to do this why is return statement only needed if you have local printResult = addition(8, 2) print(printResult) and not print(addition(8, 2))
@sereneybeanie6733
@sereneybeanie6733 2 ай бұрын
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)
@osakadev
@osakadev 6 ай бұрын
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
@BedwarsRBLX 6 ай бұрын
Modulus
@osakadev
@osakadev 6 ай бұрын
@@BedwarsRBLX true
@s1nblitz
@s1nblitz 6 ай бұрын
+= 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
@osakadev 6 ай бұрын
@@s1nblitz Those are compound operators, not math operators, I'm talking about math operators
@CrackedUpEgg
@CrackedUpEgg 4 ай бұрын
mine: rad (radius i think) pi circumference sin square root ratio abs (absolute) (Length from zero) cosine round >.
@Life_of_Boredom
@Life_of_Boredom 4 ай бұрын
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
@prozabdielzoo3212 3 ай бұрын
Omg you just saved me another 1 or 2 days trying to figure this out ty!!!
@Capy5687
@Capy5687 3 ай бұрын
It took all of my braincells to understand this concept
@nyanay0
@nyanay0 3 ай бұрын
the next line is "end"
@liviii4188
@liviii4188 3 ай бұрын
so the return statement lets you use the result of a function elsewhere in your code without repeating the calculations?
@Contemptical
@Contemptical 2 ай бұрын
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
@faintvolley
@faintvolley 3 ай бұрын
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)
@Blood-StrikeGamer
@Blood-StrikeGamer 5 ай бұрын
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.
@saikonick8312
@saikonick8312 2 ай бұрын
most of your vids have the same views, that means that you make ppl be happy to learn coding! Be proud of that!
@questionmarkdude4910
@questionmarkdude4910 2 ай бұрын
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)
@SimplyTutuco
@SimplyTutuco 2 ай бұрын
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
@Demonsinful 2 ай бұрын
Wdym ,It returns the local function I think you need a dictionary it's literally straight forward.
@AanybrosS
@AanybrosS Ай бұрын
So my question is why did u in particular use the word n like wasn’t there any other word
@GrieferBT
@GrieferBT Ай бұрын
I will correct you: In order to actually understand returns, you need to realize that function calls (ex: function(n1, n2)) are actually values. The problem is that you actually have to tell the script that the result of the arguments being calculated is the value of said function call. The ‘return’ command does just that. If you don’t put in the return command, the script just runs the function and discards the result after the ‘end’ command is read. Make sense?
@frostRBX-t4s
@frostRBX-t4s Ай бұрын
--Used for organisation print("First addition sum. Not using return.") local function addition(num1, num2) --Required to work out local result = num1 + num2 --Adds num1 & num2 print(result) --Shows the result of the calculation end --Gives addition() values to work with addition(5, 2) addition(5, 4) --Used for organisation print("Second addition sum. Using return.") local function additionv2(number1, number2) local result2 = number1 + number2 --Adds the two numbers return result2 --Returns the answer of the two numbers end local printResult = additionv2(8, 2) --Defines addition2() print(printResult) --Prints the result of addition2() -- return can also be used to exit out of functions, which means that it can end the function at whatever line it is called. --Used for organisation print("First subtraction sum. Using return.") local function subtractrion(sub1, sub2) local resultOfSub = sub1 - sub2 --Subtracts the two numbers return(resultOfSub) --Returns the result of the subtraction end local subResult2 = subtractrion(34, 32) --Defines subtraction() print(subResult2) --Shows the results of the subtraction local subResult = subtractrion(65, 32) --Defines subtraction() print(subResult) --Shows the results of the subtraction --Used for organisation print("Second subtraction sum. Not using return.") local function subtraction2(subnum1, subnum2) local resultOfSub2 = subnum1 - subnum2 --Subtracting subnum1 & subnum2 print(resultOfSub2) --Shows the result of this subtraction end --Numbers to be used for subtraction. subtraction2(86, 32) subtraction2(32, 68) --One thing I noticed is that trying to do many sums using return is alot more code writing and work than just doing: --local function addition(num1, num2) -- local result = num1 + num2 -- print(result) --end --addition(5, 2) --addition(5, 4) --Because you have to do local subtraction = subtraction(54, 56) -- print(subtraction) --every single time for each number instead of just doing subtraction(43, 64)
@emmysparkinglot
@emmysparkinglot 2 ай бұрын
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
@AizerzZ
@AizerzZ 2 ай бұрын
I recommend Obsidian program as a huge notebook
@DEOgorebox
@DEOgorebox Ай бұрын
Lua is a language that if you have an ordinary brain, you can easily retain knowledge, I learned Lua in 2 evenings with kola and chips
@AizerzZ
@AizerzZ Ай бұрын
@@DEOgorebox possible only if you learned like 2harder languages before ngl. Like 2evenings a whole language cmn
@daniel_denamit724
@daniel_denamit724 4 ай бұрын
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
@korudo855 4 ай бұрын
you think youd be able to elaborate it?
@ioproto6581
@ioproto6581 3 ай бұрын
​@@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
@BruhEditsFr 3 ай бұрын
@@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.
@E.TDelusional
@E.TDelusional Ай бұрын
@@BruhEditsFr ooo i see now, but how is it different from using the arguments. Like is it better to use?
@Aeioueeeeee
@Aeioueeeeee Ай бұрын
I don’t understand. I understand ur example but not how it fits into the topic.(I don’t mean it offensive I just don’t speak English as my 1st language) I think it would logically be the same without return and not make a difference, but without it it won’t work… Idk
@hiitswednesday6319
@hiitswednesday6319 5 күн бұрын
you explain things so well i understood something that stumped me! thanks!
@V4x07
@V4x07 3 ай бұрын
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
@Bananacease69 2 ай бұрын
wow nice, this is so cool
@Roman_play012
@Roman_play012 2 ай бұрын
it doesn't actually work, i copied to test and it showed me "you died" before even dying
@python5248
@python5248 2 ай бұрын
Hmm that's prolly bcus the variable hpLeft prolly went in decimals so smth like If hpLeft
@avishyyakobov
@avishyyakobov 2 ай бұрын
Nice creativity! I kinda upgraded your code so if you stay alive it says "You're alive" local function critHit(hp, dmgtaken) local TotalDmg = hp - dmgtaken return TotalDmg end --change the hp to a number higher than dmgtaken to be alive local hpLeft = critHit(50, 60) if hpLeft
@python5248
@python5248 2 ай бұрын
@@avishyyakobov Yooo my code works? Dats so cool thnx🔥🔥🔥
@QanGaming69420
@QanGaming69420 Ай бұрын
This coding series is amazing man, keep it up. Here is my coding practice: local function multiplication(number1, number2, number3) local result = number1*number2*number3 return result end local printResult = multiplication(5,5,4) print(printResult) ---------------------- local function addition(number1, number2, number3) local result = number1+number2+number3 return result end local printResult = addition(5,5,5) print(printResult) ----------------------- local function subtraction(number1, number2) local result = number1 - number2 print (result) end local printResult subtraction(11,1) ---------------------- local function division(number1,number2) local result = number1/number2 print (result) end local printResult division(12,3)
@Timuçinn1
@Timuçinn1 4 ай бұрын
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
@ironkiller6504
@ironkiller6504 16 күн бұрын
but why do u have to use the return function? if u wouldnt say return, the burgers price would still be 9,98 soo?? i just cant understand it even though im scripting since months
@planktonuser660
@planktonuser660 2 ай бұрын
as a student taking cs major learning other coding languages, its nice that lua scripting is pretty simple, but even then im still learning alot of things that i am able to connect to other languages. Thankful for this video
@CraftedConnections
@CraftedConnections 5 ай бұрын
0:28 little Timmy : aw! I can’t make my super cool lighting McQueen obby anymore😢😢😢 I don’t know Aditwon!
@bloblets
@bloblets 2 ай бұрын
rip lil noobert
@MIDNITERBS
@MIDNITERBS 2 сағат бұрын
Keep up the great work, this series is really helping me out local function addition(number1, number2, number3) local result = number1 / number2 * number3 return result end local printResult = addition(8, 4, 10) print(printResult)
@cakeobear
@cakeobear 4 ай бұрын
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
@WaldenDexaus 4 ай бұрын
I searched on the dev forum and it says that returns can stop or give back value after calling the function
@Nexdevv
@Nexdevv 4 ай бұрын
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
@cakeobear 4 ай бұрын
@@Nexdevv tysm
@mopmopmoo7671
@mopmopmoo7671 4 ай бұрын
@@Nexdevv Pls tell me what “the thing” is I still don't understand ur explanation
@JesseMinecraftXD
@JesseMinecraftXD 4 ай бұрын
@@Nexdevv 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?
@BrenGamingYesOfficial
@BrenGamingYesOfficial 2 ай бұрын
friend: do u use a calculator me: nah, i use roblox studio
@Lejor
@Lejor 4 ай бұрын
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
@RobloxClipShorts
@RobloxClipShorts 2 ай бұрын
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
@zoid_ws1226 4 ай бұрын
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
@Sk_lled 3 ай бұрын
Yeah, I'm just starting this and I've done basic python and know most of this
@pedrotzexpacial3612
@pedrotzexpacial3612 15 күн бұрын
your series is helping me so much that i actually am watching your ads till the end so you can get the full pay, well done
@goofballer6
@goofballer6 5 ай бұрын
POV: Lil Jimmy getting ready to be a pro but can because he hasn't even reached kindergartner😂
@Ismalellel
@Ismalellel 4 ай бұрын
He doesn't even know maths LOL
@funfactmaker4924
@funfactmaker4924 4 ай бұрын
@@IsmalellelSo Jimmy,how do you solve two plus two? Jimmy : local function Addition(n1,n2) local result = n1 + n2 end Addition(2,1)
@overanimatetadchon7642
@overanimatetadchon7642 Ай бұрын
But why he can tho?🤨
@Superillness
@Superillness Ай бұрын
does he even know english?
@oxerful5426
@oxerful5426 Ай бұрын
I was having some trouble with your explanation of return statements, but I got it down in the end :D Great tutorial again
@B0MSH1K
@B0MSH1K Ай бұрын
I did this, also thank you for making these tutorials that actually work. local function addition(number1, number2) local additionresult = number1 + number2 return additionresult end local printResult = addition(8, 2) print(printResult) local function subtraction(num1, num2, num3) local subtractionresult = num1 - num2 - num3 return subtractionresult end local printsubtractionresult = subtraction(3, 19, 5) print(printsubtractionresult) local function multiplication(num1, num2, num3, num4) local multiplicationresult = num1 * num2 * num3 * num4 return multiplicationresult end local printmultiplicationresult = multiplication(5, 10, 16, 8) print(printmultiplicationresult)
@rensuakatimechi
@rensuakatimechi 2 ай бұрын
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
@kristapspriede1398
@kristapspriede1398 8 күн бұрын
Heres my learning objective code! local function addition(number1, number2, number3, number4, number5) local result = number1 + number2 + number3 - number2 * number4 + number5 - number1 return result end local printResult = addition(9.2, 0.8, 5, 2, 10) print(printResult) Result = 14.2 (not in script!)
@Localally
@Localally 4 ай бұрын
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
@RNC-o6u
@RNC-o6u 2 ай бұрын
This helped a lot, this is what I got for my code: local function Division(num1, num2, num3) local result = (num1 / num2) + num3 return result end local printResult = Division(8, 2, 4) print(printResult) local function Subtraction(num10, num9, num8, num7) local answer = (num10 - num9 - num8) / num7 return answer end local AnswerResult = Subtraction(8, 2, 4, 2) print(AnswerResult)
@hebegebe123
@hebegebe123 2 ай бұрын
Added in an extra subtraction part🤑🤑 local function subtraction(number1, number2, number3) local result = number1 + number2 - number3 return result end local printResult = subtraction(8, 2, 9) print(printResult) ~~~~~~~~~~~~~~~~~~~~~~~~~~ Output: ------------------------------------------------- 18:04:06.295 1 - Server - Functions:7 ___________________________________________________ Nice tutorial. Like others, I've always had huge game ideas that I just can't put into work. edit: for some reason in the output, youtube thinks "18:04:06" is a timestamp
@vvkiivv
@vvkiivv 3 ай бұрын
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
@lookitsadrian
@lookitsadrian Ай бұрын
i've been watching these videos and at first it was hard to follow until i found a way to focus. i play my favorite music in the background which at first might seem distracting, but for me its helpful since i an associate your awesome videos to me vibing lol
@MrToastGHG
@MrToastGHG Ай бұрын
ty for doing this content cause its so much better then from other people cause u give like homework which realy helps with the learning (this episode was hard)
@AL3X_99YT
@AL3X_99YT Ай бұрын
Wow this is just, amazing My friend has spent a week learning everything from episodes 1-8 and I’m here doing it in under an hour 😂
@trippy2910
@trippy2910 Ай бұрын
im seriously learning thank you, if you change the numbers the script at the bottom works to change the print :) local result = number1 - number2 return result end local function division(number1, number2) local result = number1 / number2 return result end local function multiplication(number1, number2) local result = number1 * number2 return result end local printResult = addition(8, 2) + subtraction(5, 10) + division(10, 2) + multiplication(9, 10) print(printResult) if printResult == 100 then print("YAY!") else print("Womp womp") end
@zephyr_playz2535
@zephyr_playz2535 5 ай бұрын
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.
@milolokk6274
@milolokk6274 3 ай бұрын
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
@vmc-mal
@vmc-mal 5 ай бұрын
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)
@H-nl9ub
@H-nl9ub 17 күн бұрын
man tysm for the guides,this really helps me ur the best! local function addition(number1,number2) local result = number1 + number2 if result == 6 then print("this is equal to 6!") elseif result == 4 then print ("this is equal to 4!") end end addition(2,4) addition(1,3)
@aaaaaaaaaaaawda
@aaaaaaaaaaaawda 25 күн бұрын
I used to struggle learning coding, but i learned python and then tried roblox coding again n it was way easier! i kinda already know these basics so im speeding through them but still a great video! . . script: local function addition(num1, num2) local result = num1 + num2 return result end local function subtraction(num1, num2) local result = num1 - num2 return result end local function multiplication(num1, num2) local result = num1 * num2 return result end local function division(num1, num2) local result = num1 / num2 return result end print(addition(2, 4)) print(subtraction(4, 5)) print(multiplication(2, 5)) print(division(5, 2))
@ump7732
@ump7732 4 ай бұрын
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)
@IceyDude1
@IceyDude1 4 ай бұрын
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
@TarekTRBW 3 ай бұрын
Agree
@TarekTRBW
@TarekTRBW 3 ай бұрын
Attractive homework bro needs to be teacher
@Imnotbald899
@Imnotbald899 4 ай бұрын
I'm gona be honest this is the first one I've done the learning objective on just because I can not get my head around what return is used for, it would be great if you could clarify but I'm guessing it's basically just like a loop thing so after the commands before it has finished it'll return to the line it's set at? (a bit bummed that you need all numbers filled out so you couldn't just do 1 + 2 you then had to divide it by something if you used the first script bit like I did) local function addition(number1, number2, number3) local result = number1 + number2 / number3 return result end local printresult = addition(8, 2, 0.5) print(printresult) local printresult = addition(12, 6, 3) local function subtraction(num1, num2) local Sresult = num1 - num2 return Sresult end local sresult = subtraction(1, 4) print(sresult) local function multiply(mul1, mul2) local mresult = mul1 * mul2 return mresult end local mresult = multiply(2, 10) print(mresult) local function divide(d1, d2) local dresult = d1 / d2 return dresult end local dresult = divide(25, 5) print(dresult)
@Imnotbald899
@Imnotbald899 4 ай бұрын
I have like 10 hours of coding under my belt though (scratch in school, best thing I mad was cocaine shark that was just a shark that span around violently and slowly moved off the board (I also had never heard of cocaine bear before))
@MR-VOXELATOR117
@MR-VOXELATOR117 2 ай бұрын
Here is the code i wrote in the last video local functions = game.Workspace.Baseplate local function TrasnparencyTest() functions.Transparency = 1 functions.Transparency = 0.5 functions.Transparency = 0 functions.Transparency = 0.5 functions.Transparency = 1 end TrasnparencyTest() TrasnparencyTest() TrasnparencyTest() local shapes = game.Workspace.ez local function MaterialTest() shapes.Material = "Brick" shapes.Material = "Pebble" shapes.Material = "Rock" end MaterialTest() MaterialTest() local shadows = game.Workspace.ez shadows.CastShadow = falselocal functions = game.Workspace.Baseplate local function TrasnparencyTest() functions.Transparency = 1 functions.Transparency = 0.5 functions.Transparency = 0 functions.Transparency = 0.5 functions.Transparency = 1 end TrasnparencyTest() TrasnparencyTest() TrasnparencyTest() local shapes = game.Workspace.ez local function MaterialTest() shapes.Material = "Brick" shapes.Material = "Pebble" shapes.Material = "Rock" end MaterialTest() MaterialTest() local shadows = game.Workspace.ez shadows.CastShadow = false yay :>
@ManoramaAdiga
@ManoramaAdiga Ай бұрын
You deserve to have way way more subs. Congratulations you got +1 sub😊
@RealOzxFR
@RealOzxFR 24 күн бұрын
Thank u dude i finally learnt Returns, I subscribed :D
@Guest_Apex
@Guest_Apex 5 ай бұрын
great video! local function subtraction (letter1, letter2) local result = letter1 - letter2 return result end local printResult = subtraction(4, 3) print(printResult)
@Desnoper091
@Desnoper091 29 күн бұрын
I’ve searched for so many tutorials, and I didn’t find any good ones but then I found this tutorial it is so good +1 sub
@navs_svan
@navs_svan 4 ай бұрын
-- 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)
@erwin-f5b
@erwin-f5b 4 ай бұрын
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! :]
@TFS-o8j
@TFS-o8j 2 ай бұрын
I love how you teach scripting because most people teach scripting real boring so thank you so much and this is what I did! local function plusUltra(number1, number2) local answer = number1 + number2 return answer end local printAnswer = plusUltra(7, 3) print(printAnswer) print("minus") local function minusUltra(number1, number2) local answer = number1 - number2 return answer end local printAnswer = minusUltra(10, 5) print(printAnswer) print("equals 5")
@tostmakinesi42
@tostmakinesi42 2 ай бұрын
what i did in this episode: local function addition(number1, number2, number3, number4) local result = (number1 + number2) * number3 - number4 return result end local printResult = addition(8, 2, 5, 35) print(printResult)
5 ай бұрын
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)
@ushouston633
@ushouston633 2 ай бұрын
i wasnt as cool in mine, but i took alot of notes local function addition(number1, number2, number3) --[inside parenthesis are our parameters] local result = number1 + number2 - number3 return result end -- return statements return the value local printResult = addition(10, 20, 15) -- adds variable to number1, number2 by using "addition()" print(printResult) -- print actually executes the command --[[ difference in arguments and parameters are that parameters are what we use to create our variables inside of the parenthesis (function caluclation) and the stuff below is the calcuations the argument is what values we throw into the function]]
@ChipiChipiKAYRA
@ChipiChipiKAYRA 3 ай бұрын
Thanks :D I will do special thanks you in my experience :D
@susguy_yk7430
@susguy_yk7430 9 күн бұрын
Hey! I don't know if anyone here is active since these videos was posted 5 months ago.. But I'd like to tell the people that are also learning Lua script codelanguage (Just like me) that if u sit and stare at a code and try to understand what all the yapping and words are for and what they mean. Copy or write down the code on your pc and paste it on ChatGPT and ask the robot what all the words are telling you or what they do! This helped me ALOT. Make sure (only if u need) to ask the Bot to adapt the language to the way only YOU understand it so it gets easier! That also really helped me as i got language disorder and adhd. But take care guys i love helping (if this even helped or did i just yap for nothing😭🙏🏽)
@Lilisa33
@Lilisa33 3 ай бұрын
can I ask, whats the point of the "return" command, when it seems like it didnt really do anything to the code?
@SaimonasMartinkus
@SaimonasMartinkus 8 күн бұрын
we need more people like you :) local function multiply(num1, num2, num3, num4) local multynum1andnum2 = num1 * num2 print(multynum1andnum2) local divinum1andnum2 = num3 / num4 print(divinum1andnum2) end multiply(4, 12, 86, 3)
@zoriHandled
@zoriHandled 4 ай бұрын
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!
@Fehertyras
@Fehertyras 2 ай бұрын
12:32 here it is: local function add(n1, n2) local res = n1 + n2 print(res) end local function sub(n1, n2) local res = n1 - n2 print(res) end local function multi(n1, n2) local res = n1 * n2 print(res) end local function div(n1, n2) local res = n1 / n2 print(res) end add(5, 2) sub(8, 3) multi(7, 7) div(2, 2)
@vishwakarmakaushal259
@vishwakarmakaushal259 3 ай бұрын
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)
@valbro1
@valbro1 5 күн бұрын
local function additionVariable(num1, num2) local result = num1 + num2 return result end local printResult = additionVariable(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 and the rest of the function will not run. local function subtractionVariable(num3, num4) local result2 = num3 - num4 return result2 end local printresult2 = subtractionVariable(10, 5) print(printresult2) local function multiplicationVariable(num5, num6) local result3 = num5 * num6 return result3 end local printresult3 = multiplicationVariable(9, 9) print(printresult3) local function divisionVariable(num7, num8) local result4 = num7 / num8 return result4 end local printresult4 = divisionVariable(50, 5) print(printresult4)
@Sof_Holl
@Sof_Holl 5 ай бұрын
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 :)
@srcgisrealwow
@srcgisrealwow 4 ай бұрын
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!!
@soyyoluca5248
@soyyoluca5248 3 ай бұрын
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!
@LaufzDS
@LaufzDS 4 ай бұрын
great videos, i learnt alot and still learning!
@ShadowX_z
@ShadowX_z 11 күн бұрын
wow im learning so much ty my script- local function addition(number1, number2) local result = number1 + number2 return result end local pResult = addition(1, 2) print(pResult) local function subtraction(ee1, ee2) local sres = ee1 - ee2 return sres end local eresult = subtraction(10, 5) print(eresult)
@idkkkkkkkkkkk111
@idkkkkkkkkkkk111 Ай бұрын
Here are some codes I made! Subtraction: local function subtraction(number1, number2) local result = number1 - number2 return result end local printResult = subtraction(5, 9) print(printResult) Addition: local function addition(number1, number2) local result = number1 + number2 return result end local printResult = addition(5, 9) print(printResult) Multiplication: local function multiplication(number1, number2) local result = number1 * number2 return result end local printResult = multiplication(5, 9) print(printResult) Division: local function division(number1, number2) local result = number1 / number2 return result end local printResult = division(5, 9) print(printResult)
@Shaunp_MH17
@Shaunp_MH17 Ай бұрын
This is really helpful
@RawPidgeonYummy
@RawPidgeonYummy 3 ай бұрын
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.
@eclipse00992
@eclipse00992 4 ай бұрын
local function subtraction(num1, num2, num3) local realResult = num1 - num2 - num3 return realResult end local printResult = subtraction(10, 5, 3) print(printResult) wonderful episode!
@HaaziqFayaz
@HaaziqFayaz 19 күн бұрын
Thanks a whole lot, cant stop thanking local function Work(N1, N2, N3) local Result = (N1 - N2 / N3) return Result end local WorkRes = Work(8, 9 , 1) print(WorkRes)
@duolingouser851
@duolingouser851 Ай бұрын
Knowing the first certified course of Python, we can add (moreover, concatenate) two strings in lua too! ... additions("5" + "2") which in the output, will show 52 as they cannot handle plus operation. Butm they can handle multiplication. additions("5" * "2") = 10
@muhdaaqib
@muhdaaqib 6 ай бұрын
-- 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)
@williamwizard
@williamwizard Ай бұрын
thank you for the series!! my friends and i use it to learn lua so we can make our own game one day, and so far every concepr is explained really clearly!! thank you local function mult(num1, num2) local res = num1 * num2 local res2 = num1 * num2 * 2 print(res) print(res2) end mult(3, 4) local function dev(num1, num2) local res3 = num1 / num2 return res3 end local prRes = dev(6, 3) print(prRes)
@mato8816
@mato8816 Ай бұрын
the fact that anyone can learn with your video is amazing
@shaungeorge7570
@shaungeorge7570 Ай бұрын
BrawlDev you are helping me so much. Thank you!
@dowgerrollaheyboy
@dowgerrollaheyboy 7 күн бұрын
first: local add = 1 + 1 print(add) local sub = 2 - 1 print(sub) local multiply = 1 * 2 print(multiply) local divide = 2 / 1 print(divide) another 2: local function add(num1, num2) local result = num1 + num2 print(result) end add(5677656565, 8789) add(4, 6) add(6, 8) add(9) third: local function add(num1, num2) local result = num1 + num2 return result end local printresult = add(6.5, 7) print(printresult) print(printresult) local function calculate(num1, num2) local result = (num1 - num2) print(result) end calculate(5, 3)
@Meanfella
@Meanfella 4 ай бұрын
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)
@birthdayboyplayz
@birthdayboyplayz 4 ай бұрын
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)
@XqlWasTaken
@XqlWasTaken 4 ай бұрын
--functions-- local function addition(number1, number2) --adds number1 and number 2 which can later be specified because of return command local result = number1 + number2 return result end local printResult = addition(8, 2)-- creates the number 1 and 2 question print(printResult)-- prints the result of question local function addition(number1, number2) --adds number1 and number 2 which can later be specified because of return command local result = number1 - number2 return result end local printResult = addition(5, 10)-- creates the number 1 and 2 question print(printResult)-- prints the result of question local function addition(number1, number2) --adds number1 and number 2 which can later be specified because of return command local result = number1 * number2 return result end local printResult = addition(10, 10)-- creates the number 1 and 2 question print(printResult)-- prints the result of question 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)
@AggelosYT22
@AggelosYT22 13 сағат бұрын
I accidentely did some addition in the strings episode 😁 local function addition(n1, n2) local result = n1 + n2 return result end local printResult = addition(8, 2) print(printResult) local function multiplication(n2, n3) local result = n2 * n3 return result end local multi = multiplication(2, 544) print(multi) local function division(n3, n4) local result = n3 / n4 return result end local div = division(544, 4) print(div) local function substraction(n5, n4) local result = n5 - n4 return result end local sub = substraction(73, 4) print(sub)
@EugescoJuve10
@EugescoJuve10 3 ай бұрын
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!
@Freaky_KJ.1
@Freaky_KJ.1 2 ай бұрын
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)
@blade6309
@blade6309 5 ай бұрын
--Commands will do the math when triggered + - * / local additon = 2 + 2 print(additon) ------------------- --Use the () to create variables that can be refered to within the function local function Addition(number1, number2) local result = number1 + number2 print(result) end --When triggering set values for each variable in () Addition(5, 2) Addition(7, 12) Addition(1, 4) --You can use strings and yes/no as trigger values if the function calculation makes sense ------------------- --return sends the result back to the trigger that activated it local function add(Num1, Num2) local result = Num1 + Num2 return result end --You can make vairables run math local printResult = add(1, 6) print (printResult) --You can also use return to end a function at that line, stopping the rest from running -------------------- local LMG = 2 local Metal = 2 local function WallPen(Pen, Thick) local result = Pen - Thick return result end local printResult = WallPen(LMG, Metal) print(printResult)
@mr.chromo
@mr.chromo 3 ай бұрын
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)
@IceyDude1
@IceyDude1 3 ай бұрын
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
@grainter5
@grainter5 Ай бұрын
here's a simplified version of the code BrawlDev wrote in this episode: local function addition(number1, number2) return number1 + number2 end print(addition(8, 2))
@gapperss
@gapperss 22 күн бұрын
Btw if ur struggling to figure out how to multiply and divide the symbol for multiplication is * so number1 * number2 would mulply both number and if for division it would be a front slash / so num1 / num2 to divide num2 from the first number subtraction is a dash (-) incase u forgot
If Statements - Roblox Beginners Scripting Tutorial #8 (2024)
12:51
Running "Hello World!" in 10 FORBIDDEN Programming Languages
18:07
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Scoping - Roblox Beginners Scripting Tutorial #9 (2024)
10:15
Can 5 Devs make a STORY GAME in 24 HOURS?
19:55
CodeBro29
Рет қаралды 115 М.
I made a VIRAL Roblox Game in 3 days...
4:19
Kaizen
Рет қаралды 17 М.
Why Roblox Studio is Confusing For Beginners
15:22
ByteBlox
Рет қаралды 139 М.
My game is 262,000 times faster than Minecraft. I'll show you how.
12:20
IGoByLotsOfNames
Рет қаралды 1,3 МЛН
I Made a Roblox Tower Defense Game in 30 Days
9:46
Supdoggy
Рет қаралды 83 М.
Roblox Module Scripts (The Right Way)
15:20
qweekertom
Рет қаралды 25 М.
I Learned How to SCRIPT in 7 Days | Roblox
11:00
Simjet
Рет қаралды 137 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН