Making it easier to drop and pickup tools?

I want players to be able to drop and pick up tools. but when I try to drop a tool it drops for a split second then gets picked back up again making it impossible to drop it.

I tried something like this:

local tool = script.Parent.Parent
local debounce = false
while true do
	wait()
	if tool.Parent == game.Workspace and not debounce then
		
		debounce = true
		tool.CanBeDropped = false
		wait(1)
		tool.CanBeDropped = true
		debounce = false
		
		
	end
end

but this seems to do nothing.
is there a way to change how fast a tool can be picked up again after being dropped?

3 Likes

When you drop a tool a TouchInterest is added to the handle of the tool. Maybe try removing this TouchInterest the second it is dropped and then re-adding it a few seconds after?

Edit: Just realized you cannot create Touchinterest with Instance.new

1 Like

I thought of parenting touchinterest to something temporarily, but it wont let me parent it to anything.

I am willing to admit I can’t figure this out(I’ve sat in studio for 20 minutes now trying lol), I’m excited to see if this is even possible. The only possible thing I can think of is making your own custom system where you disable the tool being dropped entirely, detect when the player hits backspace, remove the tool from the player’s backpack, clone it to workspace without a touchinterest, and then detecting when the tool is touched yourself. This would make it full customization but may be more inefficient I don’t know.

Another thing, does the tool drop right on the player when they drop it? When I drop a tool it drops a bit in front of me so I have to go and walk to pick it up. I’m surprised the tool for you instantly gets picked up. Good luck though! I hope someone finds an answer I’m interested as well!

I think using a while true do loop here is redundant. Please consider using listeners in order to perform such action. This script will prevent players from dropping the tool after having it equipped.

local tool = script.Parent.Parent
local cooldown = 0
tool:GetPropertyChangedSignal("Parent"):Connect(function()
	if (tool.Parent:IsA("Model") or tool.Parent:IsA("Backpack")) and cooldown =< 0 then
		cooldown = 2
		tool.CanBeDropped = false

		local start = tick()
		while cooldown > 0 do
			wait() 
			cooldown = cooldown - (tick() - start)
		end

		tool.CanBeDropped = true
--	else
--		cooldown = 2 -- lol extending time
	end
end)

The hacky solution for parenting the handle to workspace away from the tool and then reparent the handle to the tool after dropping.

What I personally do for dropping and picking up items, is that I create two versions of the tool:

  1. An actual tool that you can hold and use
  2. Just the parts in a model; what you would want to see when you drop the item
    Both of which are saved in game.ServerStorage

In the tool, I have a script/localscript combo that checks when the player presses a key (For me, I check ‘Q’), and when the player presses this button, clones the worldmodel from storage and places it on the ground (deleting the tool of course). Now when you press ‘Q’ and drop the tool, it is a model and not a tool instance, so it won’t instantly get picked up by people.

In order for the “worldmodel” to be picked up as an item again, all you gotta do is add a ClickDetector and a script to the worldmodel that goes “When the ClickDetector gets clicked, clone the actual tool from ServerStorage into their backpack, and delete this model”. If you instead want items to be picked up on touch instead of being clicked on, you could always check the .Touched event of the baseparts your worldmodel is comprised of.

If you would like, I could comprise a little place file to show you how that works.

1 Like

I had a feeling I might have to customize more than expected. I was hoping to use roblox’s default drop and pickup system to save me time and space, but I see theres no way around that.
I will go ahead and try your method out.