Player = game.Players.LocalPlayer
local tool = Instance.new("Tool")
tool.Parent = Player.Backpack
local mouse = Player:GetMouse()
tool.Name = "SOMETHING"
local tool2 = Instance.new("Part", tool)
tool2.Transparency = 1
tool2.Name = "Handle"
tool.Selected:connect(function()
mouse.KeyDown:connect(function(key)
if key == "z" then
print("TESTING")
end
end)
end)
How do I make it so when I un-equip the tool and then I press Z, nothing will happen?

2 comments
Thank you, but can you also demonstrate how to use a debounce? I've asked around and people said its complicated to explain.
http://wiki.roblox.com/index.php/Debounce