Wondering which would be a better way to inflict “Debuffs”
What i was using before is when the bullet hits someone, i send the player and the debuff to a module script where it does the damage / slowing ect then returns
But what i thought i could do instead is just handling debuffs on the character with a script,
Like have the character have a debuff folder and and when a debuff is added, it will do all the stuff for it debuff with the script in the character
Just wondering if i should stick to system #1 or move to system #2
If theres a better way lmk
You can transition to the second system if you really wanted to, however personally I think managing all your data in a module keeps your code cleaner and easier to manage. In addition, you can monitor the data being sent and recieved to have a better idea of dependencies.
Both ways should work but I think it comes down to what you want to do with the debuffs.
Using the ModuleScript is the cleaner way and what I would do if it’s just going to be accessed by the server, but if you want all of the players in the game to know when a player is debuffed, it could be easier to have a Debuff folder within the characters and use Changed events to replicate visual effects to the clients easily. Really just depends on what’s easiest for you.