What is the self keyword in Lua? - Roblox Studio

  Рет қаралды 29,874

B Ricey

B Ricey

Күн бұрын

Пікірлер
@TerribleTonyShow
@TerribleTonyShow 3 жыл бұрын
this video sounds like philosophical when ever you say "what is self," great video
@BRicey
@BRicey 3 жыл бұрын
lol thanks hey you never know roblox dev teaches you life skills and knowledge
@siddhapandeypanigrahi353
@siddhapandeypanigrahi353 3 жыл бұрын
Really helped me in object oriented coding lua course for understanding actual uses of collection service and how it's used in module script Thx Saw ur collection service vid too by the way
@ImUkoo
@ImUkoo 2 жыл бұрын
cool thx for letttis us know that u watch one of his videos
@ImUkoo
@ImUkoo 2 жыл бұрын
💀
@seishinstudio1249
@seishinstudio1249 2 жыл бұрын
collection service is one of the most useful services on roblox
@iceyboi
@iceyboi Жыл бұрын
I legit thought "self" referred to the script or was another way of saying script.Parent but I never used this. This video was helpful but I haven't found a use for it yet though...
@360sauce7
@360sauce7 Жыл бұрын
PSX uses this method. self is like each individual pet in the game
@pokemonmytomgo
@pokemonmytomgo 2 жыл бұрын
i have no idea what i just learned but thank you
@execute214
@execute214 Жыл бұрын
module:call() is the same thing as module.call(module) when you define a function with : it's called a method and it's first parameter will always be self function module:print() print(self) end module.print("Hello, world!") this code compiles
@fabianemdi1
@fabianemdi1 3 жыл бұрын
Recently just learned about self, this is really good👍🏼
@danielnolan8049
@danielnolan8049 Жыл бұрын
Interesting, I didn't know you could put functions into tables, and call them like that. Correct me if I'm wrong but I believe that's what's going on in the module example. Here's what I think the code in the module example is saying. function module.doSomething(...) -- defines and adds a function labeled doSomething into a table called module. function module:doSomething(...) -- should be equivalent to function module.doSomething(self, ...) a function that takes an argument called self as well as a potential list of additional arguments. module.doSomething(...) -- as far as I can tell this function call tells the interpreter to go to the table labeled module, so it can find, and run a function called doSomething with a list of arguments. module:doSomething(...) -- should be the same code as, module.doSomething(module, ...). The colon character appears to be short for put the string before the : into the list of arguments as the first argument. Again please correct me if I'm wrong.😅
@BRicey
@BRicey Жыл бұрын
basically right, but its not necessarily the string verbatum, its just the object (whether that be a table or an Instance (for Roblox stuff))
@theboyoddee
@theboyoddee 3 жыл бұрын
Your tutorials help me exploit in roblox
@siddhapandeypanigrahi353
@siddhapandeypanigrahi353 3 жыл бұрын
Lol
@mikhailthepro
@mikhailthepro 3 жыл бұрын
Sqme
@swordlegend3256
@swordlegend3256 2 жыл бұрын
He's tutorials help me to make anticheat to prevent from exploiting in roblox
@anthonygaming0246
@anthonygaming0246 2 жыл бұрын
Exploits are for those with skill issues, it’s a fact to the entire Roblox community.
@nevenapavlovic9936
@nevenapavlovic9936 2 жыл бұрын
@@anthonygaming0246 fax
@real_quandie
@real_quandie 10 ай бұрын
wait ":" in module functions used for oop..? ive always used it no matter what is doing my module
@JarOfPrickles
@JarOfPrickles 3 жыл бұрын
I don't understand, but i'll understand it eventually
@AlexTechie
@AlexTechie 2 жыл бұрын
That's because the video isn't very good at explaining self. I'm sure he understands it, but doesn't know how to convey his understanding.
@Czectly
@Czectly Жыл бұрын
this made perfect sense to me thanks
@purpIed
@purpIed 3 жыл бұрын
Interesting video, thank you.
@player9315
@player9315 2 жыл бұрын
So if I do a function in the module script that has : it would automatically set self? And the value of self is the argument that you passed in the function?
@BRicey
@BRicey 2 жыл бұрын
Close, but self would be set to the thing you are calling the function on
@player9315
@player9315 2 жыл бұрын
@@BRicey so it’s good for some settings stuff?
@Vytor_01
@Vytor_01 6 ай бұрын
how is no one talking about the colored subtitles? i mean, i didnt know it was possible
@rc8s
@rc8s 6 ай бұрын
Yeah, KZbin lets you use different file formats for captions, and you can set the color and position of them. I’ve been experimenting with multiple ways to notate code, because coding videos are tricky to caption right. I haven’t color-coded all of his videos that I captioned, but the ones that I have I think work well!
@Vytor_01
@Vytor_01 6 ай бұрын
@@rc8s you coded his captions? thats amazing dude!
@rc8s
@rc8s 6 ай бұрын
@@Vytor_01 Yep! At the end you can see “-- Captions by rc8s --.” I’ve never seen coding videos captioned, so I thought it would be cool to do that and use colors. Quotation marks worked horribly. In the start I also would just not caption the code at all and instead put an ellipsis (…) at the end of whatever he says (like “Then we’re going to write… [His code shows on screen]”). Colors seem to work best so far, and since it got a comment, I’ll continue doing it.
@CoolChris-vn8hz
@CoolChris-vn8hz 3 жыл бұрын
Is there ever any reason to call functions with a dot rather than a colon then?
@BRicey
@BRicey 3 жыл бұрын
Yes, if you don't need to use self (like a static function in other languages like java), then use a dot. Always use a dot when possible
@dejo095
@dejo095 3 жыл бұрын
@@BRicey you mean always use colon when possible, not dot
@gamolacountryballs2293
@gamolacountryballs2293 2 жыл бұрын
@@dejo095 no, just the opposite
@karlmarx2704
@karlmarx2704 3 жыл бұрын
There is no self, only the people, silly
@kokobroxd
@kokobroxd 2 жыл бұрын
cool!
@myAnxiousWorld
@myAnxiousWorld 3 жыл бұрын
Hi
@MattVSNNL
@MattVSNNL 2 жыл бұрын
I kinda get it
@qxxrd
@qxxrd 2 жыл бұрын
hey can you do a tutorial on ALL keywords in Roblox?
@kpm25
@kpm25 2 жыл бұрын
it's not a keyword but a default name...
@BRicey
@BRicey 2 жыл бұрын
in hindsight you're correct but for people looking it up and for the grammar of the title to work I just put it this way.
@kpm25
@kpm25 2 жыл бұрын
@@BRicey no worries, just for clarification, this confused me too.
@JPCamitan
@JPCamitan 3 жыл бұрын
How to make bow with arrow advanced with animations?
@tohereknowswhen779
@tohereknowswhen779 2 жыл бұрын
u should be more a bit comprehensive
@BRicey
@BRicey 2 жыл бұрын
What do you mean?
@tohereknowswhen779
@tohereknowswhen779 2 жыл бұрын
@@BRicey noo sorry wrong videoo lmaooo
@tomsterbg8130
@tomsterbg8130 Жыл бұрын
As cool and useful as this may look like I really find the way of using self as just a bad way when you don't know how to name your variable. Even when I objectify my code so much that it's completely abstract I still see no reason to use self, it just worsens the readability. And the fact that you can easily fall in misleading problems with the colons just speaks for itself, this is not a good practice.
What is Object Oriented Progamming?
13:27
GnomeCode
Рет қаралды 49 М.
Composition Over Inheritance - OOP in Roblox Studio
17:31
B Ricey
Рет қаралды 23 М.
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
Жездуха 42-серия
29:26
Million Show
Рет қаралды 2,6 МЛН
How to have fun with a child 🤣 Food wrap frame! #shorts
0:21
BadaBOOM!
Рет қаралды 17 МЛН
Update 0.2.4 - Workshop, Mods & Map Editor Improvement - Fruit Playground
3:11
Fruit Playground Official
Рет қаралды 6 М.
Roblox Devs, stop misusing :WaitForChild()!
17:13
Crusherfire
Рет қаралды 81 М.
METATABLES | What are they and how can we use them?
18:40
Crusherfire
Рет қаралды 31 М.
ROBLOX SOL's RNG
9:47
Sketch
Рет қаралды 1,4 МЛН
Explaining 'Self' - Lua Tutorial (2021)
4:08
DevJeeper
Рет қаралды 11 М.
Making a Game in Lua with No Experience
5:52
Goodgis
Рет қаралды 396 М.
Stop Using Basic Data Stores - Here's Why ProfileStore is Better!
27:13
Rileybytes - Roblox
Рет қаралды 9 М.
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН