Is this way to do my game projectiles/abilities good?

I have a script inside the player character that takes the inputs, when the player presses for expample the Q key it fires a script to the server with the character the player is using and the ability (Q), then the server replicates the function of a module on every client, the module is the ability the player activated, inside the module is everything that the move does (projectile creation, hitbox and particles), i also wanted to know if it is optimized, when i spam alot of projectiles the script activity gets to 1-3%

1 Like

1-3% activity from a solo player, even if you haven’t implemented cooldowns yet is almost never good. I wouldn’t consider this method as optimized seeing as the only viable way to make this work would be using a :Clone() function with the modules which isn’t really perfected from what I’ve seen, and I can’t imagine it being effective when you’re cloning a module to every client every time the ability is cast.

I would just recommend having a library of modules that hold the ability functions already in the player, trying to stray away from cloning unnecessary objects when the ability is cast.

nono im not cloning the modules, i have the module in replicated storage with what the ability does, and when the player uses the move it fires the function inside the module on every client, i am trying to make everything client sided

1 Like