Hello! I'm having trouble scripting a Part that when touched forces a player to Unequip any tool they have Equipped. I've just started to learn how to script and I really don't have enough experience in scripting to find a solution to this, so help is appreciated!
So far this is what I've come up with:
local door = script.Parent
local function remove(otherPart)
local humanoid = otherPart.Parent:FindFirstChild('Humanoid')
local player = game.Players:FindFirstChild(otherPart.Parent.Name)
if humanoid and player then
local inHand = otherPart.Parent:FindFirstChildWhichIsA('Tool')
local inBackpack = player.Backpack:FindFirstChildWhichIsA('Tool')
if inHand then
humanoid:UnEquipTools() --attempts to unequip the player's tool but it gives me an error.
end
if inBackpack then
inBackpack:Destroy() -- destroys all tools in the player's backpack.
end
end
end
door.Touched:Connect(remove)
The goal of the script is to Unequip any tool that the player is holding and to destroy all tools in the player's Backpack when the player touches a certain Part. The line that I'm receiving an error from is the one that says (humanoid:UnEquipTools()).
After touching the Part that is supposed to unequip and remove all tools from the player, the script outputs this error:
"UnEquipTools is not a valid member of Humanoid "Workspace.businessman32246(player name).Humanoid"
I'm not really sure what this means and can't find a solution to this error.
I hope this question makes sense because it was pretty hard to explain in writing lol. Thanks!

3 comments
UnEquipTools is a typo. try replacing it with UnequipTools.
member can be a children (instance inside of it) or a property (e.g position, brickcolor etc.) or a function (in this case, UnequipTools)
Wow it was a typo all along! Thank you so much for pointing that out NGC4637 the script now works!