Hey there,
I've got this script that runs no matter if the Tool is Equipped or not so i would need it to only run if a the Tool is equipped if not it would do nothing.
Script:
local input = game:GetService("UserInputService")
local rs = game:GetService("ReplicatedStorage")
local Swing = rs:WaitForChild("Swing")
local hurt = script.Parent.Hurt.Value
local wep = script.Parent
local cooldown = .5
local db = false
input.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
if db == false then
db = true
print("Clicked")
Swing:FireServer(cooldown)
wait(cooldown)
db = false
end
end
end)
Swing.OnClientEvent:Connect(function()
wait(cooldown)
db = false
end)
Thanks,

1 comment
Got it, Check below is anyone else is interested!