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.
1 | local tool = script.Parent |
2 | tool.CanBeDropped = false |
UserInputService can be grabbed from the game to allow us to use it. To get the service, we would use:
1 | 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)
1 | function onKeyPress(inputObject, gameProcessedEvent) |
2 | if inputObject.KeyCode = = Enum.KeyCode.Backspace then |
Now that we have our function, we will create a way to call it using UserInputService.
1 | UIS.InputBegan:connect(onKeyPress) |
Now run the game and press Backspace. The tool will be removed from your player.