How do you prevent a player from picking up a tool?

It seems I’ve gotten a bunch of similar replies, so let me rephrase this in bold.

  • I need to be able to touch the tool after it’s been removed from the inventory.

  • Removing the TouchEvent, and turning off CanTouch removes the ability to touch the part you’ve selected. I still need to be able to register when someone touches the said parts.

I’ve looked on the developer forum, and it seems removing the touch interest doesn’t do much good… and removing the ability to touch the item just essentially makes it where you can’t touch it at all which is counter-productive if you want the item to damage.

How do you prevent a player from picking up a tool that’s dropped?

3 Likes

removing the touch interest will in fact prevent it from being picked up, just tested it

3 Likes

Try to set tool property “enabled” false

2 Likes

Disable the Tool by switching RequiresToolHandle or disable CanTouch on the Handle of the Tool.

TouchInterest works because of CanTouch, because CanTouch is what allows you to detect whether you touched something.

1 Like

@InfiniteYield @DasKairo @Miserable_Haven

I see that deleting the Touch Interest does work, and that it readds itself to the tool… however I still need to be able to touch the object inside the tool… including the handle.

As I stated before, I’ve already turned off CanTouch… I still need to be able to touch the tool as it’s an item i’m placing on the map. I see that deleting the Touch Interest does work, and that it readds itself to the tool… however I still need to be able to touch the object inside the tool… including the handle.

2 Likes

have you tried just having the tool on tool.Unequip place a duplicate version of itself on the map where it’s dropped so that it can have custom behavior

2 Likes

A duplicate of the tool? I would still be in the same situation, as the tool would still be able to be picked up if the player touches the handle. I was hoping to just move the tool out of the players character, and put it in workspace… and let it just sit where they put it.

1 Like

no i mean like create a model of the tool, not literally duplicate the tool. like spawn in a model of the tool and then have the tool destroy itself so its a seamless switch and you can have different behavior

I mean, you’re technically right… but I don’t want to use up too much memory, and slow my servers down by deleting so many items constantly. Destroying items tends to lag servers, or so I’ve been told.

2 Likes

do you think the server is going to explode if you delete something, like are these things running on paper and gum? lol I’m teasing but like it has like 4-8gb of ram and a single item being deleted is minuscule. plus, when you call :Destroy() on something it gets garbage collected (removed from memory).

3 Likes

just turn off the CanTouch property on the handle

You could recycle them if you’re that concerned, but the cost is really negligible.

It should work to remove the touch interest while they’re on the ground, but then add it back when the tool is picked up again. (I believe destroying the touch interest ends the connection, so you could do that then on equip just create a new touch connection.)

This code might be useful:

1 Like

Set the handle of the tools CanTouch value to false

2 Likes

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