I'd like to know a lot more about how tools work

The good news here is I actually just thought of a really clever way of dealing with this issue that won’t make me have to rewrite huge chunks of code, I can just disable the script entirely whenever the player is holding an object. (Since my grab script has nothing to do with my inventory script other than sending the server information it needs to store items.)

(This is because I made the entire script out of functions btw, so I can choose when I call them or not.)

I recommend studying other custom inventory and backpack systems to learn more about how they work. As an example:

1 Like

I made this one entirely out of folders which I am storing in each player. I’m not sure if that’s a good way to do it but I didn’t use any reference or tutorials and that’s what I thought of first.

(4 hotbars, 4 folders. I did it this way because I wanted you to be able to pick and choose your hotbars easily, so if you wanted to rearrange your inventory you could easily do so.)

Unfortunately the more customizable your inventory is, the more complicated it becomes to program and test. Personally I suggest sticking to the default backpack for now so you’ll be able to continue testing the rest of your game and in the meantime research and work on your custom inventory at your own pace in a different baseplate, then port it to your game once you have a version that works as you’d wish

1 Like

Honestly I do agree completely, BUT I feel like it has given me such motivation because it really shows you can make literally anything you want as long as you bugfix and think logically. My script works flawlessly now from what me and my friends have messed around with and tried to break, of course apart from tools which I’m just adding so it not working is a given.

1 Like

I wish I could continue helping you with this problem, but unfortunately I don’t have a custom inventory system that’s available for me to provide or is in a state where I could comfortably suggest. I noticed that the docs article about the default backpack provides useful information about the way it works behind the scenes which you can use to reverse-engineer its functionality for your inventory system:

Backpack | Documentation - Roblox Creator Hub

It’s not the inventory that’s the problem, never was.
It was actually the way I was grabbing the object which was the problem, it was a quick fix one I figured it out.

Thank you so much for your help! And one more question, Do you perhaps know how I would make the tool enable for anything other than left click? I was thinking of making it E to eat or use something like a bandage or a medkit. Thanks again!!!

1 Like

ContextActionService has a BindActivate method you can use to fire a Tool’s Activated event using a KeyCode or UserInputType:

1 Like

Gotcha, thanks and have a nice night!

1 Like

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