Is this a right way to make weapons for my game?

Planning to have my game handle around 30 players or even more, and every player will have around 3-4 weapons.
изображение
Is this a right way to make them?
If no, please tell me what im doing wrong and why

There are many ways to make weapons. If your method works, it’s great.

That’s all I am able to say with the information you’ve given.

I just want to keep my game optimised, someone said that i need to use only 1 server script + modules to make it run smooth.

Looks good to me, there’s countless ways to make weapons, my personal favorite is attaching them to the player with M6Ds so I can animated them however I want.

As far as optimization goes, like you said in a separate reply, try to keep the server scripts especially to a minimum cause lag on the server is lag for everyone (obviously)

Ten scripts doing one thing each versus one script doing ten different things will not make a difference in performance.

I’ll quote myself from another thread asking about script organization:

Honestly though, don’t get stuck because you think that this is the “right way” to do things. If you don’t understand why you would want this type of architecture, I don’t think you should try to cram your game into it.

Get something working, try to keep your code relatively modular, and you can always refactor later if you start to recognize the advantages.

1 Like

Well, thank you i guees, ill try to do something with it

It usually goes down to the question of: “Can I read my own code and properly edit and make future changes to it easily while the code still functioning properly?” pretty much. If having one script read multiple modules in folders helps you reference and easily clean up your scripts and you feel like you can easily add new functions and such inside those modules, then go for it. Become comfortable at your own scripting, it’s all your design, you make it the way you want it just as long as it works properly. Using modules can be eye candy (visually appealing) though so there’s that. Also please take into note for exploiting; make sure you’ve got plenty of checks and security before scripting everything else.

1 Like