It’s been a few hours and I just can’t wrap my head around this one.
I’m working on a move that lets the player grab-lock another player.
This requires multiple things to be done. One of these things is disabling the enemy’s tool.
However, every time I have it look for the tool in the enemy’s backpack, it tells me it’s simply not there,
while in reality the enemy has been using their tool for quite some time.
I’ve tried rechecking every time it couldn’t find the tool, but alas.
I’m pretty much out of options here.
This error happens on line 236
Brief instance where "hit" (the red orb, AKA the hitbox) accepts Touched before it is destroyed
Code that fires the event, located in a LocalScript in the tool
Code that responds to the player's client that initiated the attack, located in ServerScriptService
EDIT: So apparently, when equipping the tool, the tool gets moved from the backpack into the character model, and the reversed happens when you unequip it.
Why? I have no idea, but it looks like checking for both is necessary.
I will update this post once my issue has been fixed or not (because i have no one to test with atm)
The reason for that is because when you equip a tool (such as a key), the key would be parented to the character, so it can be used properly. If that makes any sense.
If you think of it in a real life way (with a backpack and a flashlight), you need to take the flashlight out of the backpack to use it.
Thought I’d mention like the reason.