the LocalScript is in starter player scripts
local rep = game.ReplicatedStorage local mouseDetection = rep.MouseDetection local UIS = game:GetService("UserInputService") local delayed = false local delayTime = 0 local equipped = false local tool = game.StarterPack.Katana tool.Equipped:Connect(function() equipped = true end) tool.Unequipped:Connect(function() equipped = false end) UIS.InputBegan:Connect(function(input) if delayed == false then if equipped == true and input.UserInputType == Enum.UserInputType.MouseButton1 then delayed = true mouseDetection:FireServer() if delayed == true then task.wait(delayTime) delayed = false end end end end) while true do wait(2) print(delayed) end
Where is this script located? If it's inside the tool, make the line 7 to:
local tool = script.Parent
If you didn't, do it