How to make upgradable guns?

I’m making a gun system and I’m wondering if I can make a system where you can upgrade your guns stats, for example

Quick Hands - Increased Reload Speed by 15%”

What would the best way to do this be? Values? Attributes? And how should I actually handle the changing of the stats themselves, fire an event to the gun to change the stats?

I’m thinking maybe add a configuration or a folder into a player with all upgrades as attributes.

For changing the stats it depends on the gun system, I suppose the stats are values/attributes located inside the gun model, which are accessed by gun script, I don’t have experience with how gun systems work, but for example of reload time is based on task.wait we can check if the upgrade attribute is true, if so it can wait reduced time.

Instead of using if, else you can also make the attribute change to the percentage, so if upgrade isn’t bought, it will be at 0, and if it is, then at 15, it also gives capability of making upgrade tiers, for example every tier giving +5%. Then we can multiply the wait time by the value.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.