``function GetBullet()
local p = Instance.new("Part")
p.Shape = Enum.PartType.Ball
p.Parent = workspace
p.Size = Vector3.new(.5, .1, .5)
p.BrickColor = BrickColor.Black()
p.CanCollide = false
Instance.new("BodyVelocity", p)
return p
end
script.Parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
local mH = mouse.Hit
local bullet = GetBullet()
bullet.CFrame = script.Parent.Handle.CFrame * CFrame.new(0, 0, -1.5)
bullet.CFrame = CFrame.new(bullet.Position, mH.p)
bullet.BodyVelocity.Velocity = bullet.CFrame.LookVector * 120
bullet.Touched:Connect(function(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
Humanoid:TakeDamage(15)
bullet:Destroy()
end
end)
end)
end)
help me put a cooldown on this script

1 comment
it works thx