Custom Tool System: Equipping and Unequipping not working as intended

I just switched my remote events for functions and it now works as intended, but no I tried several different orders and it didn’t change anything.

Interesting, is there code on the server that needs to run for the equip behavior to work? If so, that could be why. I guess the problem is solved then?

It is, but no there is no server code which is “required” for say, for now the server code is so other players know what item you are currently holding.

All I can think of is that the bindable events are happening so rapidly that the code executes at the same time causing the value of equipped to end up being sort of randomly picked. Perhaps that is why RemoteFunction is helping because it adds a short delay. I don’t use BindableEvents often but I haven’t had this issue before. Perhaps add a debounce for tool selecting so that you cannot rapidly spam equip/unequip within 0.2 seconds of each other or so.

This is incase anyone is curious as to why the issue was happening:

I found out that the way I setup my inventory is by having a folder in the player which made it so the code is not executed while being in the player’s inventory, only while being in the character so therefore when I fired the equipped bindable event it was still in the inventory instead of the character making it so it doesn’t fire.

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