Ah, here it is.
--This would go in the starterpack.
Player = script.Parent.Parent --Get the player.
Tool = Instance.new("Tool") --Create a tool.
Handle = Instance.new("Part",Tool) --Make a handle part so it will equip.
Handle.Name = "Handle" --Make sure it's called handle, or it won't work.
Tool.Equipped:connect(function(mouse) --When it's equipped fire a function.
Tool.Parent = nil --Delete the tool so they don't see anything.
mouse.KeyDown:connect(function(key) --When they press a key fire a function.
print(key) --Print the key they pressed.
end) --End the key function.
end) --End the equip function.
Tool.Parent = Player.Character --Parent it to the their character AFTER we have the equipped function ready so it will fire. |