Тёмный

Tables - Roblox Beginners Scripting Tutorial #17 (2024) 

BrawlDev
Подписаться 22 тыс.
Просмотров 21 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 213   
@BrawlDevRBLX
@BrawlDevRBLX 3 месяца назад
To clarify pairs() and ipairs(): pairs() is used to iterate through dictionaries ipairs() is used to iterate through arrays **only**. This is because elements in an array are numerically ordered, while a dictionary is unordered. I don't think I made that clear so my apologies.
@osakadev
@osakadev 3 месяца назад
btw, ipairs and pairs are optional, yall can just do: for i, v in arrayOrDict do end and will work the same, but it's not recommended, so...
@صاحب-العقل-والمنطق
@صاحب-العقل-والمنطق 3 месяца назад
@@osakadev Why isn't it recommended?
@osakadev
@osakadev 3 месяца назад
@@صاحب-العقل-والمنطق for readability and possible performance problems (even if it is too little). if you dont use pairs or ipairs, it does not indicate what kind of table is the one we are iterating just by looking at it, and we will need to go to see what we are iterating, and it is annoying, and roblox does not recommend it
@JayceeParamio
@JayceeParamio 2 месяца назад
thats why when i tried to put i pairs on the menu version it didnt work brah lol
@CooperW-we5dz
@CooperW-we5dz Месяц назад
Pairs() work completely fine for me in arrays and it’s in order the only difference between pairs() and ipairs() in arrays that I know of is that ipairs() if it reaches nil inside of a table than it dosen’t do the rest of the table unlike pairs()
@zawadgoat
@zawadgoat Месяц назад
the thing is you got only few thousand views . but you decided to teach and continued . you deserve so much respect . i really appreciate it .Thanks
@cobyjacob2054
@cobyjacob2054 2 месяца назад
-- Buying from a menu local menu = { ["Burger"] = 15, ["Fries"] = 5, ["Cola"] = 4, ["Milk"] = 3, } menu["Burger"] = 12 print(menu["Burger"], " dollars for a burger,", menu["Fries"], " dollars for fries and", menu["Cola"], "dollars for a cola") print("That would be", menu["Burger"] + menu["Fries"] + menu["Cola"], "dollars in total!") -- Output 1: 12 dollars for a burger, 5 dollars for fries and 4 dollars for a cola -- Output 2: That would be 21 dollars in total!
@JohnPaul-v2f
@JohnPaul-v2f Месяц назад
@cobyjacob2054 1 month ago -- Buying from a menu local menu = { ["Burger"] = 15, ["Fries"] = 5, ["Cola"] = 4, ["Milk"] = 3, } menu["Burger"] = 12 print(menu["Burger"], " dollars for a burger,", menu["Fries"], " dollars for fries and", menu["Cola"], "dollars for a cola") print("That would be", menu["Burger"] + menu["Fries"] + menu["Cola"], "dollars in total!") -- Output 1: 12 dollars for a burger, 5 dollars for fries and 4 dollars for a cola -- Output 2: That would be 21 dollars in total!
@gryal8143
@gryal8143 2 месяца назад
26:45 we thank you more for all the tutorials
@Kyoryokuna_Fallen
@Kyoryokuna_Fallen Месяц назад
We appreciate the tutorials BrawlDev :)
@zrinskidestroyer3121
@zrinskidestroyer3121 3 месяца назад
Thank you so so so much for your tutorials! Love them and learned a lot!
@bazerduck1234
@bazerduck1234 3 месяца назад
thanks for being consistent!
@pocketsz1
@pocketsz1 Месяц назад
Thank you so much for these tutorials, they helped a lot and are well organized :D
@kaicamry2894
@kaicamry2894 2 месяца назад
Thank for these tutorials they were great now I can move on to the advanced tutorials.
@vmc-mal
@vmc-mal 3 месяца назад
Mannnnn, I am finally done and yeah! I have learned quite a lot throughout this playlist/tutorial guide... Excited to do the next video (Making an actual game >:))
@goodnoob857
@goodnoob857 2 месяца назад
I think after these all series I am not beginner programmer but I feel like intermediate programmer with you
@trikymirkygaming2701
@trikymirkygaming2701 Месяц назад
Don't take it bad but you aren't.
@okinawakor
@okinawakor Месяц назад
@@trikymirkygaming2701 u did not have to be negative for no reason u dont know how good bro is lower ur ego
@SniffishBowl
@SniffishBowl Месяц назад
​@@trikymirkygaming2701You don't even know this guy 💀
@Apple_Tie
@Apple_Tie Месяц назад
@@okinawakor he said he feels like he is intermediate
@fandedeto4603
@fandedeto4603 Месяц назад
@@trikymirkygaming2701 lol
@XemnaSoul
@XemnaSoul День назад
Thank you so much of these tutorials!
@NotDanTGBalt
@NotDanTGBalt Месяц назад
UPDATE: If you do print(myArray) now, IT WORKS! This is what the output looks like: OUTPUT: [1] = 10, [2] = "string", [3] = true, [4] = 500
@ilikechocolate_idk
@ilikechocolate_idk 16 дней назад
apparently, this just works for dictionaries, if you just do normal arrays, this wont appear. edit: even for dictionaries its not working to me, so idk
@sammyawad4933
@sammyawad4933 2 месяца назад
i have a notepad to help me follow along with studio bc my attention spans crap and i think i wrote down everything u said lmao. great vid
@erdiicraft3370
@erdiicraft3370 3 месяца назад
local lvl6 = game.Workspace[" Levels"].Level6 local part = {lvl6.Part, lvl6.Part1, lvl6.Part2, lvl6.Part3, lvl6.Part4, lvl6.Part5, lvl6.Part6, lvl6.Part7, lvl6.Part8} local num = 1 while true do part[num].CanCollide = true part[num].Transparency = 0 task.wait(1.5) part[num].CanCollide = false part[num].Transparency = 0.8 num = num + 1 if num == 10 then num = 1 end end -- that going to make a obstacle move forward and backward
@TropialGamingYT
@TropialGamingYT 2 месяца назад
Took me a whole week to work through this and it was worth it i now know what tutorials talk about and also code my own small games like an obby
@warm.8807
@warm.8807 2 месяца назад
dope man, learned a lot from your tutorials thank you
@Nox2000YT
@Nox2000YT 2 месяца назад
These tutorials are so helpful! I have no idea how I could've learned Luau without this tutorial.
@ForTheMemes
@ForTheMemes 2 месяца назад
thank you, this journey was really helpful !
@kabato88
@kabato88 3 месяца назад
Fr u save me bro i was a completly nooby in script and don't even know about anything, but now i fell i can finnaly progress by ur tutorial TYSM !
@nishantbista6353
@nishantbista6353 3 месяца назад
This is the best tutorial i need so far for simulator games thank you so much
@صاحب-العقل-والمنطق
@صاحب-العقل-والمنطق 3 месяца назад
congrats on the new shirt:)
@PatPat647
@PatPat647 3 месяца назад
Thank you so much! I want to make a game on Roblox which looks like it could be really popular. I am on my own and I don't like to hire people! I'm good at making models and maps and the scripting was the only thing stopping me! The game i am making is my first one and it will be really good!
@Vertect
@Vertect 2 месяца назад
Could you provide a quick summary of your game? I agree with you; I can model, build, and design, but I don't have experience with scripting. I think it's more beneficial and rewarding to learn everything on my own rather than paying someone else to do it!
@PatPat647
@PatPat647 2 месяца назад
@@Vertect sorry man. I kinda wanna keep it a secret but it is based on a murder mystery game. Mine has lots of differences I don't want to share at the moment. I will reply again once the game is done and I will provide the game. I don't want anyone copying at the moment.
@OxygenEnjoy
@OxygenEnjoy 23 дня назад
Broski be sure to update us in this comment section once you made it ✊
@SimplyTutuco
@SimplyTutuco 17 дней назад
update us one day :D
@subjectpacifist
@subjectpacifist Месяц назад
you are the best in the world i would have never learned about any of this anywhere else this means the world to me thank you so much!
@TordNotInf
@TordNotInf 2 месяца назад
Thank you. With your help, I was able to make a functioning gambling button with a working money system! :D
@AlexGarcia-bi9tr
@AlexGarcia-bi9tr 24 дня назад
lets go gambling ehh ah dang it ehh ah dang it ehhhh ah dang it im out of money wait how much do kideys go for
@aleksanderagren6360
@aleksanderagren6360 Месяц назад
i love this chanel, i have always had a deep intress in coding but found it to daunting to begin to learn but this chanel broke it down to bite sized pieces for me
@fascinatingfaux811
@fascinatingfaux811 2 месяца назад
Not related to the video but I made a fog using the info from this tutorial that slowly deals damage like the storm from Fortnite. It doesn’t move yet but this tutorial has taught me tons. Thanks for the help dude!
@bicolourchalk9269
@bicolourchalk9269 2 месяца назад
Super helpful thanks man
@nzm_f6425
@nzm_f6425 16 дней назад
For me who has only learned backend C++, array = {10, "string", true} looks crazy
@mufradr
@mufradr 17 часов назад
Is it cus the variables aren’t typed? I’m pretty sure u can do it in Roblox lua but it’s not required
@Mr_TopMan
@Mr_TopMan 3 месяца назад
No way you actually did a tutorial at table lets goo!!!!! keep making good video man
@LewisLoinsen13
@LewisLoinsen13 3 месяца назад
Nice tutorial but i have a question, what is the difference of "game.Workspace.Part" instead we can just simply write "workspace.Part"
@BrawlDevRBLX
@BrawlDevRBLX 3 месяца назад
Both basically do the same thing. The difference is that 'workspace' is a built-in keyword and 'game.Workspace' is how you access the Workspace folder inside the game data model.
@LewisLoinsen13
@LewisLoinsen13 3 месяца назад
Ohh okay thanks for the information!
@osakadev
@osakadev 3 месяца назад
Summary Tables are a type of data collection in LUAU (a data collection is basically a variable which can contain many values inside it) There are 2 types of tables in LUAU: Arrays and Dictionaries - Array: They are tables whose elements are indexed with numbers based on the position of the element we want to get, for example: array[4]. This gets the element in position 4 of the array - Dictionaries: These are tables whose indexes are a data type other than a number (i.e. you can not index by doing dict[4]). So to index, you must do it with the name of the "key" (the key is the name that refers to a certain value, this name is used only to access the value contained) as follows: dict["name"]. This will get the dictionary value with the key "name" What is indexing? Indexing is to ACCESS a specific value in an array or dictionary based on the key that references it, by default, the arrays have as index a number (from 1 to the number of elements). While the dictionaries, will depend on what value you put, whether it is a text, a reference in memory, a part, or whatever "#" as operator The # symbol is used to get the number of elements in an ARRAY (this does not work with dictionaries, if you try it, you will get 0 even if you have values).
@صاحب-العقل-والمنطق
@صاحب-العقل-والمنطق 3 месяца назад
Thank you!
@Sturgeon22
@Sturgeon22 3 месяца назад
@@osakadev This essay was your way of saying "I have to poop" ? Left me on read crazy how these people switch up.😞
@t8bx
@t8bx 3 месяца назад
thanks, this cleared a lot of confusion for me :)
@shiver8191
@shiver8191 Месяц назад
dude i love ur summaries helps me out so much
@osakadev
@osakadev Месяц назад
@@shiver8191 You welcome
@hechiv6085
@hechiv6085 3 месяца назад
Bro's speedrunning the scripting series Just kidding. I've been able to study scripting consistently because of your consistent uploads. Thank you, man💯
@CheeseY420
@CheeseY420 3 месяца назад
your kinda wrong with the pairs and ipairs part, because ipairs iterates through arrays, while pairs iterates through both arrays and dictionaries. Meaning you can't use ipairs with dictionaries, only arrays.
@BrawlDevRBLX
@BrawlDevRBLX 3 месяца назад
Good catch! Although the documentation says pairs is only used with dictionaries, while ipairs is used with arrays. They recommend using a combination of the two for full capabilities (depending on the problem).
@personguyIII
@personguyIII 18 дней назад
"we are gonna set this cheeseburger to 15 dollars something ridiculous" california:
@lexierdiaz6653
@lexierdiaz6653 11 дней назад
oh god, i saw "arrays" in the youtube time section and had flashbacks to my coding class
@AC-rx6fr
@AC-rx6fr 24 дня назад
From what it looks, it seems that dictionaries work similarly to hashtables, in that case it makes sense why pairs shows itmes in a "random" order
@Mr_kruh97
@Mr_kruh97 3 месяца назад
This was a great episode
@FrozeyOnAero
@FrozeyOnAero 16 дней назад
*DICTIONARY WORK* _Heres what I did for the dictionary:_ local menu = { ["1"] = "Cheeseburger", ["2"] = "Coke", ["3"] = "Hamburger", ["2"] = "Pancakes", ["1"] = "Bacon & Eggs", } print(menu["1"]) *ANSWER = "Bacon & Eggs"*
@CodeByteCrafter
@CodeByteCrafter 3 месяца назад
local Array = {5, 10, 55-54} for A = 1, #Array do print(Array[A]) end -- This is A Type Of Table Called Array. -- Array Is A Data Structure That Can Hold Multiple Values. table.insert(Array, 50) print(Array[4]) if Array[4] == nil then print("There's not a 4th position") else print("There's a 4th position") end -- table.insert is a function that is used to add more values inside of an array. table.remove(Array, 4) print(Array[4]) if Array[4] ~= nil then print("4th position still exist") else print("4th position has been taken") end -- table.remove is a function that is used to remove values from an array. if table.find(Array, 10) then print("10 has been found") end -- This is the first way to find a value in an array -- table.find is a function that is used to find values from an array. for i = 1, #Array do if Array[i] == 1 then print("1 has been found") end end -- This is the 2nd way to find a value in an array (using for loop)
@Zarpulsion
@Zarpulsion 2 месяца назад
local partsFolder = Instance.new("Folder",workspace) for index = 1,8 do task.wait(1) local part = Instance.new("Part") part.BrickColor = BrickColor.random() part.Position = Vector3.new(0,20,0) part.Parent = partsFolder print("part created") end local partsTable = partsFolder:GetChildren() --returns all the children inside our specified instance and converts them into a array table for _,parts in ipairs(partsTable) do task.wait(1) parts:Destroy() print("Part",_,"Destroyed") end moving up! these tutorials have been so helpful and im very excited to move on to the advanced guide
@TropialGamingYT
@TropialGamingYT 2 месяца назад
bro how!? I can't remember most of it
@Zarpulsion
@Zarpulsion 2 месяца назад
@@TropialGamingYT just keep going at it always try to make a couple custom examples for yourself so it helps you really understand and keep what you learned inside your head
@XqlWasTaken
@XqlWasTaken 2 месяца назад
2:41 checkpoint for myself
@Nie_Kapi
@Nie_Kapi Месяц назад
thanks for tutorials :)
@CoolPruitt
@CoolPruitt 2 месяца назад
6:48 If your using Roblox studio, it will actually print out all the elements in the array. He was probably using a older version of roblox studio when he uploaded this video.
@Fellthrogures
@Fellthrogures 2 дня назад
This is useful for ragdoll.
@AHMAD_1566
@AHMAD_1566 3 месяца назад
Great video, when will you talk about raycasts?
@robloxmanthestan
@robloxmanthestan 3 месяца назад
local activatie = { ["activatie1"] = 18,--roler coster ["activatie2"] = 33,--bungie jumping ["activatie3"] = 10,--trampoline ["activatie4"] = 13,--eating contest } for menuItems, price in pairs(activatie) do print(menuItems, price) end your are a amazing teachir for scripting its been my dream to know how to script and become a game maker and when i reach that goal i will remeber that you where the first persone to ever motivate me to keep moving thank you with all my heart
@memmememememm
@memmememememm Месяц назад
This is the best tables tutorial i have watched holy shit.
@mathbrah
@mathbrah 3 месяца назад
local array = {1, 2, 3, 4, 5, 6, 7, 8, 9} for _, num, in ipairs(array) do print(num) end
@keen5760
@keen5760 2 месяца назад
very good tutorial W
@Soul-zi8sw
@Soul-zi8sw 2 месяца назад
ive been scripting for 6 months and would appreciate if you make a video about metatables and object oriented programming since it is a useful tool in roblox studio
@Interloper-lz9ok
@Interloper-lz9ok 20 дней назад
dawg i just realized we spell it like "Cheeseburger" not "Cheezeburger" with a z 💀💀💀💀💀
@mrsherlock8793
@mrsherlock8793 18 дней назад
its chezburger what are you talking about?
@rodneysot
@rodneysot 2 месяца назад
My little script local smallSupermarket = { ["Apple"] = 5, ["Banana"] = 3, ["Mango"] = 8, ["Bread"] = 2 } for index, i in pairs (smallSupermarket) do print(index, i) end
@user-xx9jk6wm3v
@user-xx9jk6wm3v 2 месяца назад
heres what i did local store = { ["Book"] = 10, ["Chair"]= 30, ["Blankets"]= 15, } for storeItem, cost in pairs(store) do print(storeItem,cost) end
@aapple7993
@aapple7993 2 месяца назад
--Locatates model, them gets the items within the model, then uses for loop to order items and rename (SO hyped for the next vid!) local model = game.Workspace.Model local items = model:GetChildren() for index, item in ipairs(items) do items[1].Name = 'Part 1' items[2].Name = 'Part 2' items[3].Name = 'Part 3' print(item) end -- kept it simple today
@TheOnlyChunti
@TheOnlyChunti 2 месяца назад
omg dude i cant explain how much it ur code helped me to fix my coins system i couldnt figure it out even after watching the video that how do i get the coins directly without calling out every single coin thanks dude really appreciate that
@West_Deal
@West_Deal 5 дней назад
love you bro
@vali0us
@vali0us 4 дня назад
This logic teleports a part randomly within the parameters local part = game.Workspace.randomPart while true do local randomX = math.random(0,100) local randomY = math.random(0,1.5) local randomZ = math.random(0,100) part.Position = Vector3.new(randomX, randomY, randomZ) task.wait(1) end
@aUsernameNoOneHasButMe
@aUsernameNoOneHasButMe 2 месяца назад
local theWorkspace = game.Workspace local Plate = game.Workspace.Plate local isThePLatetouched = false Plate.Touched:Connect(function(partTouching) if isThePLatetouched == false then isThePLatetouched = true local humanoid = partTouching.Parent:FindFirstChild("Humanoid") if humanoid then print("Your workspace consists of...") for index, part in pairs(theWorkspace:GetChildren()) do print(part.Name) task.wait(1) end end isThePLatetouched = false end end) -- what this does is basically whenever we touch the Plate inside of the workspace, it states every item in the Workspace. It also takes a cooldown for a second after stating one item after the other item.
@CodeByteCrafter
@CodeByteCrafter 3 месяца назад
Thank you so much for this series looking forward to the challenges and finally moving on to the advanced series ♥
@llYuki0okami
@llYuki0okami 27 дней назад
Note if we want to get all object that are inside of Model, not just its Children, and also we want to check if we getting a Parts not other things it will looks like this; -- Get all the Parts inside the Model for _, part in pairs(model:GetDescendants()) do -- Check if the part is a Part if part:IsA("BasePart") then -- Print the name of the Part print(part.Name) end end
@SPF-ti9qv
@SPF-ti9qv 3 месяца назад
--[[local menu = { --table Chessburger = 15, ---a value inside of the table BloxyCola = 5, ---a value inside of the table Pizza = 25, ---a value inside of the table Tacos = 10 ---a value inside of the table } for MenuItem, Price in pairs(menu) do ---does a for loop and does a pair loop randomly print(MenuItem, Price) ---prints the menu item and price end--]] ---menu["Chessburger"] = 5 ---print(menu["Chessburger"]) --[[local menu = { ---table ["CheeseBurger"] = 15, ---a value inside of the table ["BloxyCola"] = 5, ---a value inside of the table ["Pizza"] = 25, ---a value inside of the table ["Tacos"] = 10 ---a value inside of the table } menu.CheeseBurger = 5 print(menu.CheeseBurger)--]] --print(menu["CheeseBurger"], menu["BloxyCola"], menu["Pizza"], menu["Tacos"])--]] --[[local MyArray = {10,20,30,40,50,60,70,80,90,100} ---Array(type of table) for _ (can be i or _), number in ipairs(MyArray) do ---does a for loop that is ipairs (sequence) print(number) end--]] ---for i =1, #MyArray do --for loop in --print(MyArray[i]) --prints my array --end --table.insert(MyArray, 40)---inserts number ---for i =1, #MyArray do --for loop in # --print(MyArray[i])--prints my array --end --table.remove(MyArray, 4)---removes the array local model = game.Workspace.MyModel for index, part in pairs(model:GetChildren()) do print(part.Name) end
@Lord.M21
@Lord.M21 Месяц назад
😱😮🤯🤯
@JG_Orion
@JG_Orion 3 месяца назад
Hello, I've watching your tutorial and I am having fun with it, I would just like to ask if you could create a tutorial on creating a basic game manager that is in the module, I know you have a tutorial on module script already, but what I would like to see is on an actual game manager that can perform basic game like an loop game, I know its kinda lot to ask for, but I would like to have a server game manager incorporated with a module script that can be use for loop game
@bobthebuilder-do1rt
@bobthebuilder-do1rt 10 дней назад
If you and cobebro29 collabed you could create a entire roblox story game
@KiskesWorld
@KiskesWorld Месяц назад
The best roblox studio teacher ever😅Thank you so much for everything ❤
@MartintheGAMER-un7lt
@MartintheGAMER-un7lt Месяц назад
wait a minute, if you've seen this comment please answer my question 🙏🙏🙏🙏: Q1.)Does index represent the variable in the for loop or the index of the numbers in the array which is "myArray" Q2.) Could someone pls clarify the for loop for me pls🙏🙏
@bobuxcartel4051
@bobuxcartel4051 Месяц назад
local model = game.Workspace.Model for _ , part in ipairs(model:GetChildren()) do print(part.Name) part.BrickColor = BrickColor.Random() end
@JohnPaul-v2f
@JohnPaul-v2f Месяц назад
this was 2 months ago? insane
@mypetmoose2079
@mypetmoose2079 Месяц назад
you made a burger cost 15 and called it ridiculous, but sometimes that's how much they cost here in california :(
@venekeT
@venekeT 16 дней назад
lmao
@Snow-mw5jm
@Snow-mw5jm Месяц назад
local mcbonaldsmenu = { ["ShinyBurger"] = 2, ["FrenchFriesOfDoom"] = 5, ["Sparkingbottle"] = 3, } for menuItem, Price in pairs(mcbonaldsmenu) do print(menuItem,Price) end
@andreyromashchenko8967
@andreyromashchenko8967 10 дней назад
You should be using tables to change parts’ properties. But you did it the lazy way: print(). Im a visual learner and i got no visuals here.
@simple_minecraft_player
@simple_minecraft_player 3 месяца назад
When will the next serie published ? it looks nice :)
@BrawlDevRBLX
@BrawlDevRBLX 3 месяца назад
There won't be a remake of the advanced series but we will be continuing the advanced and gui series that already exist!
@simple_minecraft_player
@simple_minecraft_player 3 месяца назад
@@BrawlDevRBLX Thx i'm interisting by the advanced serie
@rizzzzzlestudios5555
@rizzzzzlestudios5555 2 дня назад
good video
@atotallylazyperson
@atotallylazyperson Месяц назад
ok with programming now! NOW GIVE US BUILDING TUTORIALS. /j
@lord8207
@lord8207 Месяц назад
unfortunately I tried to grab the value from the leaderstats but I just didnt know how to get it so I got stuck pretty much that. I wanted to use the value of the stats to determine if a print statement showed saying what things you could afford but I just didnt got it to work.
@yod4202
@yod4202 29 дней назад
thanks
@simple_minecraft_player
@simple_minecraft_player 3 месяца назад
Will you remake another advanced serie after the begginer serie ?
@BrawlDevRBLX
@BrawlDevRBLX 3 месяца назад
No
@simple_minecraft_player
@simple_minecraft_player 3 месяца назад
@@BrawlDevRBLX so the current advenczd serie is again available ?
@koalatitanxd326
@koalatitanxd326 5 дней назад
thats a expensive burger cuz
@NotDanTGBalt
@NotDanTGBalt Месяц назад
-- This is what I did (I basically made it so when you touch that touchPart we made in a previous episode, you "get" a pet: local rollablePets = { commonPet = "COMMON DOG", commonPet2 = "COMMON CAT", commonPet3 = "COMMON LIZARD", commonPet4 = "COMMON GUINEA PIG", commonPet5 = "COMMON BUNNY", uncommonPet = "UNCOMMON ELEPHANT", uncommonPet2 = "UNCOMMON LION", uncommonPet3 = "UNCOMMON TIGER", uncommonPet4 = "UNCOMMON RHINO", uncommonPet5 = "UNCOMMON GAZELLE", rarePet = "RARE SHEEP", rarePet2 = "RARE COW", rarePet3 = "RARE MONKEY", rarePet4 = "RARE HORSE", rarePet5 = "RARE PENGUIN", mythicalPet = "MYTHICAL RAINBOW AZUNE", mythicalPet2 = "MYTHICAL DRAGON", mythicalPet3 = "MYTHICAL RUDOLPH", mythicalPet4 = "MYTHICAL UNICORN", mythicalPet5 = "MYTHICAL ????", } local tp = game.Workspace.touchPart local partIsTouched = false local debounce = 2 game:GetService("Players").PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(character) tp.Touched:Connect(function(otherPart) if partIsTouched == false then partIsTouched = true if otherPart.Parent == plr.Character then local petRandomizer = math.random(1,20) if petRandomizer == 1 then print("You got a(n) "..rollablePets.commonPet.." 1/20") end if petRandomizer == 2 then print("You got a(n) "..rollablePets.commonPet2.." 2/20") end if petRandomizer == 3 then print("You got a(n) "..rollablePets.commonPet3.." 3/20") end if petRandomizer == 4 then print("You got a(n) "..rollablePets.commonPet4.." 4/20") end if petRandomizer == 5 then print("You got a(n) "..rollablePets.commonPet5.." 5/20") end if petRandomizer == 6 then print("You got a(n) "..rollablePets.uncommonPet.." 6/20") end if petRandomizer == 7 then print("You got a(n) "..rollablePets.uncommonPet2.." 7/20") end if petRandomizer == 8 then print("You got a(n) "..rollablePets.uncommonPet3.." 8/20") end if petRandomizer == 9 then print("You got a(n) "..rollablePets.uncommonPet4.." 9/20") end if petRandomizer == 10 then print("You got a(n) "..rollablePets.uncommonPet5.." 10/20") end if petRandomizer == 11 then print("You got a(n) "..rollablePets.rarePet.." 11/20") end if petRandomizer == 12 then print("You got a(n) "..rollablePets.rarePet2.." 12/20") end if petRandomizer == 13 then print("You got a(n) "..rollablePets.rarePet3.." 13/20") end if petRandomizer == 14 then print("You got a(n) "..rollablePets.rarePet4.." 14/20") end if petRandomizer == 15 then print("You got a(n) "..rollablePets.rarePet5.." 15/20") end if petRandomizer == 16 then print("You got a(n) "..rollablePets.mythicalPet.." 16/20") end if petRandomizer == 17 then print("You got a(n) "..rollablePets.mythicalPet2.." 17/20") end if petRandomizer == 18 then print("You got a(n) "..rollablePets.mythicalPet3.." 18/20") end if petRandomizer == 19 then print("You got a(n) "..rollablePets.mythicalPet4.." 19/20") end if petRandomizer == 20 then print("You got a(n) "..rollablePets.mythicalPet5.." 20/20") end end task.wait(debounce) partIsTouched = false end end) end) end)
@Stickmangold360
@Stickmangold360 Месяц назад
wrong vid btw
@Stickmangold360
@Stickmangold360 Месяц назад
oh wait nvm
@bradenknipp9362
@bradenknipp9362 Месяц назад
6:19 for this why dont you have to add a final number to show in what incrimints it goes through the script? ex: mycounter = (for 2, 6, ?) you didnt clarify what would be the ? in this scenerio
@nzm_f6425
@nzm_f6425 16 дней назад
It is +1 in default
@ninjaboi_22
@ninjaboi_22 11 дней назад
20:07
@choko1919
@choko1919 Месяц назад
local menu = { ["Berger"] = 10, ["LazyBerger"] = 9, } menu["Berger"] = 9 print(menu["Berger"], "is the Bergerprice",menu["LazyBerger"], "is the LazyBerger Price") print(menu["Berger"]+menu["LazyBerger"] ,"All Prices") --Shop
@Vortex_Edit.2000
@Vortex_Edit.2000 18 дней назад
local menu = { ["Burger"] = 6, ["Fries"] = 8, ["CheesBurger"] = 9, ["Pizza"] = 14, ["Cola drink"] = 2, } menu["Burger"] = 12 print(menu["Burger"], menu["Fries"], menu["CheesBurger"], menu["Pizza"], menu["Cola drink"])
@barry0_0
@barry0_0 23 дня назад
25:39
@boggyreal
@boggyreal 25 дней назад
better than tapwater ngl
@Dark-cy9fu
@Dark-cy9fu 3 месяца назад
does the underscore in ipairs and pairs really change anything?
@BrawlDevRBLX
@BrawlDevRBLX 3 месяца назад
Not necessarily. I find it better for readability and also it’s less variables to deal with when you’re not using them.
@صاحب-العقل-والمنطق
@صاحب-العقل-والمنطق 3 месяца назад
@@BrawlDevRBLX 31 SECONDS AGO INSAAAAAAAAAANE!!
@osakadev
@osakadev 3 месяца назад
No, it's just to tell the compiler this: "hey, i wont use this variable, ghost it" (ghost is like saying, ignore this variable, if you use it, roblox will show a warning
@osakadev
@osakadev 3 месяца назад
@@BrawlDevRBLX it is not really to have less variables, the memory continues occupying it and the value continues being there, it is only to indicate to the linter and luau that we are not going to use that variable. And also to say to the one that reads it that it is not necessary, it's a weird luau feature 🤓
@Dark-cy9fu
@Dark-cy9fu 3 месяца назад
@@osakadev it wont give an error even if you dont use the underscore, the index value is just there if you need to use it at any given time. I dont get why you would replace it with a underscore when it doesnt change your code at all
@angus-jr9qg
@angus-jr9qg 8 дней назад
my entry for learning opportunity this code makes it to where when i hit a button it gives to opposite colors local Discofloor = game.Workspace.Gaming local button = Discofloor:FindFirstChild("Button") local part = Discofloor:FindFirstChild("Bing bong") local part2 = Discofloor:FindFirstChild("Bing boing") button.Touched:Connect(function(BasePart) local c = math.random() part.Color = Color3.fromHSV(c,1,1) local d = 1-c part2.Color = Color3.fromHSV(d,1,1) task.wait(0.1) end)
@goodnoob857
@goodnoob857 2 месяца назад
Also I tried to script after these series but I forgot almost everything after this series, well my memory sucks everytime but can you give me tip how to remember it ?
@connerybligh9768
@connerybligh9768 2 месяца назад
Do it dozens of times and hammer it in your brain.
@nzm_f6425
@nzm_f6425 16 дней назад
Just do programming
@MelonFarmer15
@MelonFarmer15 Месяц назад
--[[local myArray = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100} for _, number in ipairs(myArray) do print(number) end]] --[[local menu = { ["Cheeseburger"] = 4, ["Cola"] = 4, ["Sword"] = 50, ["MedPack"] = 50, } for menuItem, price in pairs(menu) do print(menuItem, price) end]] local model = game.Workspace.Model for index, part in pairs(model:GetChildren()) do print(part.Name) end
@ChipiChipiKAYRA
@ChipiChipiKAYRA Месяц назад
Restourant is so cheap :D
@Lab_Potato
@Lab_Potato 17 дней назад
ONE MORE EPISODE (im a sigma)
@mavs529
@mavs529 Месяц назад
Bro is teaching programming for free
@nzm_f6425
@nzm_f6425 16 дней назад
true
@anonimuroman
@anonimuroman 2 месяца назад
7:22
@seandorama5932
@seandorama5932 2 месяца назад
Taking Notes :D (ironically here’s a note for me or anyone else reading, most these timestamps aren’t accurate I just subtract like 1-3 seconds from where I stopped to take down notes) 1:03 So tables are kinda like variables but they can *store multiple kinds of data* (examples so far have been numbers, booleans, and strings) 2:13 Tables are made using {} and are done in an order? 3:04 and 3:12 They’re done from left to right, which the first/leftmost value having a positional value of 1, which each next one being a higher number (the second value’s got a position of 2, the third has a position of 3, etc.) 2:42 To add another piece of data/value you just to need to use a comma before adding another one 3:12 to access data inside Arrays you need to use their positional value in the table. And then use [] with their positional value to access it like this 4:04 4:51 to print out all everything in the array you gotta make a for loop (lol I basically paraphrased what you said) 4:57 the loop’s starting value will use the first positional value in the array, which is always 1 (although maybe I could skip the first value by making it 2 but I have no idea if that would work or if that has a use) 8:14 Perfect explanations as always (this is literally the 2nd video I’ve watched from you XD) 9:06 so that’s what “i” means, “index”. I was always confused on what it meant when I saw it in scripts and dev forums Now what does index mean XD 10:22 Once again, perfect 👌 also yay now I know what an Index is… a table’s positional value 💀 Well I will be calling it index from now on it’s so short and simple compared to typing out positional value. Also I’m gonna type the rest of this in the comments of my own comment since this main one is bugging out like hell because I’m on mobile
@seandorama5932
@seandorama5932 2 месяца назад
11:09 so table.insert uses values/the kind of data you wanna put in, but table.insert uses the position of the existing value you want to remove
@seandorama5932
@seandorama5932 2 месяца назад
11:56 the lame and long way 💀 12:49 the cool way 😎
@seandorama5932
@seandorama5932 2 месяца назад
13:43 I’m confused on how this works or why you’d need the index but cool
@seandorama5932
@seandorama5932 2 месяца назад
14:07 NOOOOOO NOT MORE TABLES ARGHGHTHTHTHGHGH-
@seandorama5932
@seandorama5932 2 месяца назад
15:01 So basically Dictionaries are Arrays but the items inside are also variables. Or I guess a better way to describe them would be before with Arrays you had a shelf with a plaque and boxes tagged with numbers on the side (that also automatically change based on where they’re placed… don’t ask how) but dictionaries are the same thing but the boxes have a plaque/name too! 16:57 dang guess my first analog
@Boop_your_nose
@Boop_your_nose Месяц назад
this is my code thank you -- Coffee Shop menu and price local coffeeshop = { ["Coffee"] = 2, ["latte"] = 3, ["Fruit"] = 2, ["Sandwhich"] = 3, ["water"] = 0, ["muffins"] = 2, ["pastries"] = 2 } for menuItem, price in pairs(coffeeshop) do print(menuItem, price) end
@Vincity9000
@Vincity9000 14 дней назад
how does Tables help?
@neogamer123
@neogamer123 2 месяца назад
Array index start with 1‼Oh god why they can't follow other programming languages
@Mesuid
@Mesuid Месяц назад
is this what searching in games are?
@AbdulMezooghi
@AbdulMezooghi 3 месяца назад
Is this the last video of the beginner tutorial
@Tyger-Games
@Tyger-Games Месяц назад
2nd to last
@Tyger-Games
@Tyger-Games Месяц назад
One more
@Cateatschips
@Cateatschips 3 месяца назад
is there a reason why mine is printing {...} - Server - tables:3 instead of a hash value
@troydylandurban9950
@troydylandurban9950 3 месяца назад
idk bruh i got the same thing
@refleks904
@refleks904 2 месяца назад
i still dont understand whats the use of pairs() and ipairs()
@fea3ther
@fea3ther 9 дней назад
u got it now?
Далее
Шок-контент! 😱
00:50
Просмотров 1,9 млн
How I Made a 3D Platformer in 2D Game Engine
21:23
Просмотров 523 тыс.
I Made a Horror Game Using ChatGPT
8:47
Просмотров 9 тыс.
What Is The Best AI For Roblox Studio Scripting?
10:42
Просмотров 453 тыс.
I Asked Roblox Billionaires How To Get Rich
41:51
Просмотров 2,6 млн
Making a Game in Lua with No Experience
5:52
Просмотров 323 тыс.
How “Impossible” Features Are Actually Coded
20:47
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 627 тыс.