so i have a tool in the starterpack, and within this tool there is a localscript.
so im trying to make it so that you can ONLY activate this key function when the tool is equipped, but the script seems to not run. if there is a bug, what could it be?
local UserInputService = game:GetService("UserInputService")
local tool = script.Parent
local function onInputBegan(input,gameProcessed)
tool.Equipped:Connect(function()
if input.KeyCode == Enum.KeyCode.F then
print("it worked.")
end
end)
end
UserInputService.InputBegan:connect(onInputBegan)
