Like I know if tool has canbedropped == true and you hit backspace itl just change location to game.Workspace while canbedropped == false itl go to backpack. I want to completly change what backspace does instead of doing any of these 2. Is this possible? For example hitting backspace will delete the tool itself completly
How exactly can I control what backspace does to a tool?
1 answer
Hello there. To answer your question, there are multiple ways to override the 2 functions you had mentioned. For this answer, I will use UserInputService. This service allows you to grab inputs from the keyboard. First, you should disable the CanBeDropped property from the tool.
local tool = script.Parent
tool.CanBeDropped = false
UserInputService can be grabbed from the game to allow us to use it. To get the service, we would use:
local UIS = game:GetService("UserInputService")
Now that we have the service, we would have a function that would tell the server what to do when the key Backspace is pressed. In this case, we will destroy the tool, meaning it will be removed from the player. (Note that it won't be removed from the StarterPack if it was placed there)
function onKeyPress(inputObject, gameProcessedEvent) -- Create function
if inputObject.KeyCode == Enum.KeyCode.Backspace then -- If the player pressed Backspace
tool:Destroy() -- Delete the tool
end
end
Now that we have our function, we will create a way to call it using UserInputService.
UIS.InputBegan:connect(onKeyPress) -- UIS is the service variable we defined before. onKeyPress is the name of the function.
Now run the game and press Backspace. The tool will be removed from your player.
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
I know that much but what I want to know if if CanBeDropped == false wouldnt the ball go to backpack automatically once a player hits backspace?
It will, but it will also run the code above.
do you have an idea on which one will go first?
The function onKeyPress() will override the default function if CanBeDropped == false.
Ohhhh alright sick. One more thing, when I tested this i made it print something instead of deleting the tool just for understanding but it printed the same thing like 200 times with 1 backspace. Is there anyway it can just print once like idk to look nice ig
Oh, I never tried print debugging, I'm still looking into UserInputService. I'll get back to you ASAP.
ii thanks