Roblox OOP (Object Oriented Programming)

I’m still learning OOP and it’s kind of fun to make this! Great tutorial! :grinning_face_with_smiling_eyes:

6 Likes

Thank you !! Please do not hesitate to ask me if you have any questions!!

5 Likes

I’m gonna have to bump this, it’s amazing!

5 Likes

I was having a hard time understanding what the whole ._index did but after reading this post I understand now! Thanks! This helped me understand OOP a bit more!

9 Likes

Hi! Thank you very much for this tutorial, I was able to understand metatables better! Is there any way to implement function overwriting? Thanks :grinning:

2 Likes

Hi,I know it’s been several month since you did this post but can you answer a question that has been bothering me for a while and it’s that why do people use self and why most oop are using it .

Thanks either way :grinning:

2 Likes

Sorry for the late reply, if you haven’t already figured it out by now, self is basically a way to call the table of information you’ve created in your example.New() function.

If you want a more detailed explanation with examples, let me know!

1 Like

I apologize for the late reply (I really outdid myself with that one)

I’d like you to elaborate on what you mean by function overwriting. Like the ability to reconstruct a function and it’s ability from scratch? I’m not too sure what you mean.

2 Likes

If you dont mind answering another question and that is why is oop so important I mean like a table that just contain info about the gun how do people find that useful I just dont get why people use it

1 Like

There is already a tutorial from 2014 about this…


though I appreciate this, I am using OOP now :wink:

3 Likes

You can have not only info but everything you need for your gun.

People will use this because it is a more efficient approach, that’s really it. You don’t have to use OOP at all but it makes it much easier for you as your games get more complicated. Duplicating a gun would not require making a new script, using classes you can make new guns with little effort etc

2 Likes

I cant seem to see any images. Is it my device problem or is it gone?

4 Likes

I can’t seem to see any either, I’m not sure why the images stopped appearing, I’ll try to re-upload the images, Thank you for your patience!

5 Likes

wait how would you use the “powerup” in this case

1 Like

Why people still use OOP while we got module… 4 year I hear that, 4 year I never understand how the hell it can help…

1 Like

It simplifies things and makes them easier to maintain and modify. You can go to one script where that one thing is located, rather than searching through multiple scripts to find it.

1 Like

That what I call a module… It do that exactly

1 Like

I just realized this topic is about OOP and not modules

1 Like
1 Like

What about the static method for metatable?

1 Like