Thanks to Soybeen on Roblox Forums for the help:

local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer

function UnequipTools()
for _,v in next,player.Character:GetChildren() do
if v:IsA("Tool") then
v.Parent = player.Backpack
end
end
end

uis.InputBegan:connect(function(input,gp)
if gp then return end
local key = input.KeyCode
if key == Enum.KeyCode.Q then
UnequipTools()
end
end
end)