Hello developers! For a quick background understanding, I am working on a game that has many different types of guns, and many players with them.
I have already set up the baseline for a system for the guns to take away player’s health (The health I am using is not the real Roblox health system, it is a value in a replicatedStorage folder full of player stats and data for the game). The question is, once this gun detects a player, I need to manage how much health is taken, firing the player’s response, putting it up on the chat if the player died, etc.
So which way is the best way of dealing with this, within the Weapon’s code itself, within a ModuleScript, or using a bindable event function?
I already understand how to use all of these, but I am on the stage now of mitigating spaghetti code, and am trying my best to optimize it.
- Do all of the code in the weapon script itself
- Use a ModuleScript
- Use a BindableEvent function
0 voters