Failure at removing touchinterest from a tool

So, I want to make it so that the player cannot pick up a tool by touching it, I’m doing this with

handle.AncestryChanged:Connect(function()
	if handle:FindFirstChild("TouchInterest") then
		handle.TouchInterest:Destroy()
	end
end)

Which works normally, until I drop the object. Despite the fact that ancestrychanged should trigger from dropping the object, it seems to do nothing, and as such, the touchinterest is recreated.

I’m not too sure about this, but do you think it’s possible that you’re checking for the TouchInterest too soon? To your if-then statement, can you add an else statement that just prints something like “Failure to find touchinterest”

Didn’t consider that, a print checking returned nil.

Turns out using a waitforchild for the touch interest fixed it.

1 Like

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