Can't unequip tool when player is seated

Inside my weapon script, I have a line that checks if the player is sitting while trying to equip a weapon

local function toolEquipped()
–…
if plr.Character.Humanoid.Sit == true and plr.Character.Humanoid.SeatPart ~= nil then
plr.Character.Humanoid:UnequipTools()
end
–…
end
–…
tool.Equipped:Connect(toolEquipped)

This gives me the warning: “Something unexpectedly tried to set the parent of [WEAPON] to Backpack while trying to set the parent of [WEAPON]. Current parent is [PLAYER].”
How can I fix this?

2 Likes

my guess is that its trying to unequip the tool too fast, try adding a task.wait() after the if statement

1 Like

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