Hello! I would be happy to help you learn OOP. Here is a dev forum post that explains OOP. If you have any other issues or don’t understand something, feel free to reply, and I’d be happy to help.
^^If this helped you feel free to mark it as the solution so other people can find it faster.
I know oop a little bit but the I have a problem with class.new function.
How do call class.new and then on the client you can get the same class.new object that you did on the server
Create the class on the server first (that’s where the real movement logic lives) then fire a RemoteEvent to tell the client to run Class.new() on its side too. Both sides use the exact same module and .new() call - they just stay in sync through the remote.
Just dont
OOP doesn’t exist in Luau, and attempting to replicate or believe in something is a definition of the word delusion and it’s very destructive.
Focus on making data-first designs instead
Functional programming or ECS (real ECS and not middleware slop)
In ECS/functional programming, to add something, you just usually make a container/dictionary to store this information; in fake OOP, you straight up make a trillion wrappers for each condition that lags the hell out of the game after updating it for a bit.
Respectfully, there is a difference between designing a game for performance and making a game for fun.
OOP and ECS/functional programming are both paradigms which people can use to make games.
In the context of Roblox’s game engine, ECS holds the advantage of being simpler and more performant in most cases due to not having excessive overhead, which the pseudo-OOP does have in lua.
Unless you are aiming for a Discovery page game, the micro/milisecond gains are not worth forcing yourself to change to a different paradigm to the one you have just started learning or are comfortable with.
Additionally, games made with OOP can be performant and enjoyable, and it is up to the developer to decide which paradigm they wish to use. You clearly have a strong preference, however, the OP clearly stated he knows a little OOP, albeit not very well, and had he known ECS that would have been a better option, which he didn’t take.
The tone of your message was very aggressive and down-putting. Let the guy do what he wants and if you want to advise him to make him aware of other paradigms, you can be tactful about it.
TL;DR it doesn’t matter which paradigm he uses since he isn’t aiming for a discovery page game. Be kinder in your tone.