Recently, I decided to change the structure of my games to something more maintainable (versus a bunch of Scripts and LocalScripts. So, I decided to use @Crazyman32’s Aero Game Framework, which allows me to use modules for all my code and uses a single LocalScript as a sort of bootstrapper.
To get myself accustomed to AGF, I decided to make a game using the framework. It was great for creating backend systems, but now I want to make a tool (more specifically, a knife) and I have no idea where to start.
I want to make a knife utilizing only OOP ModuleScripts (using AeroGameFramework). I couldn’t think of an easy way to do this, so I came here for help.
This is a pretty specific question, I know. Also, sorry if I don’t make sense.
I don’t have experience using AeroGameFramework, but I can tell you where to start on making custom tools.
I almost replicated the entire roblox tool on my own before, but just got bored and never finished it because I didn’t have a real practical application for it.
Making a tool is simply taking each component of the tool that you desire, and replicating it. First, you should move the character’s hand up so that it looks like they are holding said tool. A good part about custom tools is that this angle is editable to your desire so that the tool can be higher or lower. This would be done by rotating the joints in the player’s character. Second, you would want to weld the model to the hand that is now rotated. This can be done with a simple weld script. Then, you want to use UserInputService to listen for when a player clicks, and then when they click you check if they have a tool out, and if they have a tool out you would detect it similarly to Tool.Activated. These are a few functions of the tool, but you should be able to replicate the rest of the functions of the tool by just thinking about how it would work and scripting that manually. Good luck!