Get all of my knowledge in one package: linktr.ee/ByteBlox
@randomhuman6942011 ай бұрын
The reason why it gave you the "Attempt to call a nil value" error was because you did tableName.functionName() later, not because of the type of key.
@HorFoxPlanet11 ай бұрын
No they don't. They work the same as other programming languages, the key difference is that Luau is not restrictive with it's variable types or table/array structure by default. You can fix this by setting the script to scrict mode or by limiting or defining table structuring. The other problem which people might think is an issue is the apparent loss of ordering. This is not an engine problem, it has to do with time of execution. This can be fixed by using indexes. This tutorial was poorly planned and has mistakes, so they look a lot harder than they actually are. It's ok to do things on the go but please, prepare beforehand to avoid misinterpretations because people watching these videos usually have little to no experience with programming.
@haxking235211 ай бұрын
Just looked at what strict mode was because I didn’t know, but I’m still a tiny bit uncertain of it’s uses. Is it just used when making classes and functions so you know what type each value/param should be every time? Or are there more uses of it?
@someonerandom993911 ай бұрын
@@haxking2352it makes the typing strict like in other languages like C, so you can't make a variable with type number and then assign a string to it or something like that
@haxking235211 ай бұрын
@@someonerandom9939 ah that explanation is clearer than what I read online, thanks
@ballsack769211 ай бұрын
being able to implement instances as dictionary keys has improved optimization a TON for my games.
@CapedBojji10 ай бұрын
Not separating tables and maps is stupid. Not having an inbuilt. Length for maps is stupid. Meta tables are really dumb considering it doesn't trigger on assignment which, I guess that js meant for speed but it still could have been implemented
@sweet-corn11 ай бұрын
idk if anyone's said this but i personally reaaally like your thumbnails, especially how they have a dotted frame around it gives them a nice touch, they look cool !
@Tkdriverx11 ай бұрын
10:00 You were calling a function by the name of functionName when you changed the key to 1. You would have needed to do `tableName[1]()`
@Creeper_94511 ай бұрын
4:29 its because the table names were written in alphabetical order, and three comes before two in that order since the "h" in "three" comes before the "w" in "two", hence why it looked like that!
@Tkdriverx11 ай бұрын
Its not just Roblox though. Lua is just super open what you can do with arrays/dictionaries. Also just quick information for those confused about names: "Table" is just a higher order data type that arrays and dictionaries are based off. Arrays are "tables" that have numerical indices (usually implied, as in the first example). Dictionaries are "tables" that have strings as indices. You can also mix and match between index types, you can have some numbers, strings, etc.. However in Lua, you can place whatever you want as a key. Objects, other tables, functions, booleans, etc.. I believe these would be a form of dictionary.
@execute21411 ай бұрын
well, this is understandable, a table is the only data structure in Lua.
@Martanus11 ай бұрын
PLEASE make a video about metatables, I don't understand them and I learn extremely efficiently from your videos!
@samuelpc18011 ай бұрын
Functions with a key that is a number can be run. I like your teaching style, but at least teach things that is correct.
@40P311 ай бұрын
He forgot to remove the line tableName.functionName, which he could have used the index it would work, but the functionName does not exist.
@Eggvelop11 ай бұрын
i would like to bring up a problem, it will certainly print out the function with a index of 1, but you called the tableName.functionName() which doesnt exist anymore at 9:50
@bulletbot148611 ай бұрын
yeah thats what i wanted to point out too
@ScriptedExpert11 ай бұрын
I saw that too
@Zawaito11 ай бұрын
As it seems tables print in alphabetic order by default
@noturne5411 ай бұрын
I really don't get the point of this video. They are not unecessarily complicated, they are only extremely flexible, and I find myself using this flexibility all the time.
@xxxxxx-n1yАй бұрын
for the people tryna learn tables duh
@gamewithog11 ай бұрын
In a game, what will a table be used for?
@multistronomy11 ай бұрын
i really like watching your tutorials, i've always wondered how to do tables. it was the only thing i didn't know how to use for years. recently i discovered you and i wanted to ask if you could make a tutorial on tables but you already did it! thank you.
@JoaoMPdS11 ай бұрын
How have you coded for years without knowing tables?
@multistronomy11 ай бұрын
@@JoaoMPdS tbh idk, never needed it
@JoaoMPdS11 ай бұрын
@@multistronomy I don't know any script where I didn't use them. U use them on module scripts, on for loops. Crazy
@multistronomy11 ай бұрын
@@JoaoMPdS whoopsies
@kirillchshukin660211 ай бұрын
Hey thank you for helping us cloud you Explain the Buffer libary in roblox and mybye the Module yk
@hlflifeenjoyer617611 ай бұрын
I actually use metatables in almost all my projects a video about it would be awesome but unfortunately you're too tired so maybe later or never
@HeyShattered7 ай бұрын
Viewers who *ARE* 5 and are watching this video: am i a joke to you?
@Tactician0011 ай бұрын
The reason it doesnt work at around 9:45 is because you are running a function FunctionName which does not exist as the string was changed to a number, imagine forgetting to change it I assume tableName[1] would work, but i really am not sure
@LeapInno11 ай бұрын
Thanks. Tables didn't make a lot of sense to me.
@wonsole10 ай бұрын
Can u teach us about " Strings. " ?
@thefishdevelopment103511 ай бұрын
You should fully read the errors you get, lol. But very good content tho
@andreyromashchenko89674 ай бұрын
12:17 why though? Will that make an apple turn red? What would you achieve by writing that? …. I want to see how things you write can be applied to the game.
@x_gwb11 ай бұрын
Tables make sense but what about.. table flip?
@Sadjhj11 ай бұрын
I like tables
@stephen50704 ай бұрын
How do you manage tables on a big Roblox Studio project? I want to know if it's possible to use dot notation for automatically created tables within a Module Script. Those tables are only filled up during run time, so what are my options here ByteBlox?
@A.Theory4 ай бұрын
So underated W mans
@GetUrFunnyUp11 ай бұрын
What is this video my bro? How are tables complicated? They are an array and a dictonary
@howatcher11 ай бұрын
this is why i am the tables
@oof256811 ай бұрын
I am not In Pairs Script, I AM THE TABLES. I AM THE ONE WHO REQUIRE()
@TheCrazySuperWeasel2 ай бұрын
How do I change the key of an already created Value?
@emotionallydeprived188911 ай бұрын
OH PLEASE DO METATABLES!!!
@byteblox10011 ай бұрын
Nah bro that’s like some matrix stuff
@emotionallydeprived188911 ай бұрын
@@byteblox100 PLEASE!!! I NEED TO KNOW ABOUT THEM 😭😭😭
@lightdragon818210 ай бұрын
@@emotionallydeprived1889Metatables are used for OOP and warning something does not exist to the player via probably UI (You don't know what exactly will contain in a table) or to make them fancy. That's it. So you should only understand the __index and __newindex metamethods. The rest is BS
@wonsole10 ай бұрын
it gave me an error at the first part. it gave me " table: 0x94a50b1edb0dc5cc "
@G_odiek8 ай бұрын
I'm having the same problem, I tried to solve it multiple times, but my table still won't print, btw, if you solved the problem how did u do it???
@kaiji25427 ай бұрын
Im trying to make a table with the players in the server and wanted it to print the first player that is listed, here is the script, pls tell me for corrections: local pla = game.Players:GetPlayers() local tab = { pla } print(tab[1])
@byteblox1007 ай бұрын
GetPlayers is already a table. You don’t have to make another table, you can just do pla[1]
@imbadwithnamestoo8 ай бұрын
do you have a discord for people who need help with scripting?
@byteblox1008 ай бұрын
discord.gg/byteblox
@byteblox1008 ай бұрын
Wait the link expired lol, just check the descriptions of recent videos
@dayjobman903110 ай бұрын
tables are simple
@weridtem11 ай бұрын
Its arrays
@negerleins11 ай бұрын
key? not index?
@byteblox10011 ай бұрын
Both work
@gooberpiebuba8 ай бұрын
I'm 4 so I can't understand 💀💀💀💀💀
@bbnmm872011 ай бұрын
buddy stop doing bad tutorials you're not born to teach this is an poor table tutorial, almost all ur tuts are bad you need to have responsability you're teaching new people how to be bad programmers
@MasSensei11 ай бұрын
tables suck on roblox
@ProtogenArt9 ай бұрын
When you printed out the first value, print(tableName[1]), that told me exactly how to make a dialogue script for my shopkeeper!, heres the script i made, as i already have SOME experience with scripting. local hum = script.Parent:WaitForChild("Humanoid") local anim = Instance.new("Animation") local anim2 = Instance.new("Animation") local anim3 = Instance.new("Animation") local tableVar = {"hi!", "hello.", "hey! :3", "hi there. >:3", "i uh. broke the icecream machine again!!.. sowwy 3:", "hawoo!!! :3", "hihihihi welcome to me shop!!!! :3", "super funny text that you WONT see!!... or you will, idk! :3", "awh man... me icecream spill on ground... wutever!! i get other one!! >:3", "what would u like???? :3!!", "hai there!!!", "haaiii there!!! :3"} local messages = #tableVar anim.AnimationId = "rbxassetid://16393685271" anim2.AnimationId = "rbxassetid://16394153075" anim3.AnimationId = "rbxassetid://16394762243" local playanim = hum:LoadAnimation(anim) local playanim2 = hum:LoadAnimation(anim2) local playanim3 = hum:LoadAnimation(anim3) local numbertick = math.random(1, 10) local oldnumber wait(numbertick, print(numbertick)) playanim:Play() script.Parent.Head.Shout.Message.Text = tableVar[math.random(1, #tableVar or messages)] warn(script.Parent.Head.Shout.Message.Text) while script.Enabled == true do local funnynumber = math.random(1, #tableVar or messages) oldnumber = funnynumber wait(math.random(playanim.Length + 2, playanim.Length + 5)) playanim:Play() script.Parent.Head.Shout.Message.Text = tableVar[funnynumber] print(funnynumber or oldnumber) warn(script.Parent.Head.Shout.Message.Text) end. Thanks for all of the small tips! They still help!