I have a Tool that I would like to make UnDroppable when pressing Backspace, in which the tool will not be affected upon pressing backspace. I first tried setting the property in the tool "CanBeDropped" to false, but I've realized upon pressing Backspace it can still be unequipped through inventory. I then experimented with this script for a while:

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.KeyDown:connect(function(key)
	if key:byte() == 8 then -- 8 is equal to the Backspace Key
		--insert code here
	end
end)

After some testing, though, I noticed this script would run after the tool was dropped, making it useless. So is there a CoreScript in the tool I can mess with to make the tool Un-droppable? Or can I make my script run before the Backspace button is pressed and un-equipping the tool? All answers very much appreciated, thank you. ~Xduel

5 comments

0

There's actually a property that does just what you want. http://wiki.roblox.com/index.php?title=CanBeDropped_(Property)

0

I said in the beginning of my explanation I tried that, and it did not do what I was intending on it to do.

0

Oh my bad.

0

There is a EquipTool method on humanoid. Maybe if this script is inside a LocalScript under the tool line 5 would Player.Character:WaitForChild("Humanoid"):EquipTool(script.Parent)

0

That made the tool (when dropped) equip to another tool in the players backpack. That does seem to be down the right track, though.