sure,
function Damagefunc(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch)
if DoDamage == true then
if hit.Parent == nil then
return
end
local h = hit.Parent:FindFirstChildOfClass("Humanoid")
for _, v in pairs(hit.Parent:children()) do
if v:IsA("Humanoid") then
h = v
end
end
if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Head") ~= nil then
if hit.Parent:findFirstChild("DebounceHit") ~= nil and hit.Parent.DebounceHit.Value == true then
return
end
local c = Create("ObjectValue")({
Name = "creator",
Value = game:GetService("Players").LocalPlayer,
Parent = h
})
game:GetService("Debris"):AddItem(c, 0.5)
if HitSound ~= nil and HitPitch ~= nil then
CFuncs.Sound.Create(HitSound, hit, 1, HitPitch)
end
local Damage = math.random(minim, maxim)
local blocked = false
local block = hit.Parent:findFirstChild("Block")
if block ~= nil and block.className == "IntValue" and block.Value > 0 then
blocked = true
block.Value = block.Value - 1
print(block.Value)
end
if blocked == false then
HitHealth = h.Health
h.MaxHealth = h.MaxHealth
h.Health = h.Health - Damage
if HitHealth ~= h.Health and HitHealth ~= 0 and 0 >= h.Health and h.Parent.Name ~= "Hologram" then
print("gained kill")
dmg(h.Parent)
end
ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), -Damage, 1.5, Part.BrickColor.Color)
else
h.Health = h.Health - Damage / 2
ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), -Damage, 1.5, Part.BrickColor.Color)
end
if Type == "Knockdown" then
local hum = hit.Parent.Humanoid
hum.PlatformStand = true
coroutine.resume(coroutine.create(function(HHumanoid)
swait(1)
HHumanoid.PlatformStand = false
end), hum)
local angle = hit.Position - (Property.Position + Vector3.new(0, 0, 0)).unit
local bodvol = Create("BodyVelocity")({
velocity = angle * knockback,
P = 5000,
maxForce = Vector3.new(8000, 8000, 8000),
Parent = hit
})
local rl = Create("BodyAngularVelocity")({
P = 3000,
maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
Parent = hit
})
game:GetService("Debris"):AddItem(bodvol, 0.5)
game:GetService("Debris"):AddItem(rl, 0.5)
elseif Type == "Normal" then
local vp = Create("BodyVelocity")({
P = 500,
maxForce = Vector3.new(math.huge, 0, math.huge),
velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05
})
if knockback > 0 then
vp.Parent = hit.Parent.Head
end
game:GetService("Debris"):AddItem(vp, 0.5)
elseif Type == "Up" then
local bodyVelocity = Create("BodyVelocity")({
velocity = Vector3.new(0, 20, 0),
P = 5000,
maxForce = Vector3.new(8000, 8000, 8000),
Parent = hit
})
game:GetService("Debris"):AddItem(bodyVelocity, 0.5)
local bodyVelocity = Create("BodyVelocity")({
velocity = Vector3.new(0, 20, 0),
P = 5000,
maxForce = Vector3.new(8000, 8000, 8000),
Parent = hit
})
game:GetService("Debris"):AddItem(bodyVelocity, 1)
elseif Type == "Leech" then
local hum = hit.Parent.Humanoid
if hum ~= nil then
for i = 0, 2 do
Effects.Sphere.Create(BrickColor.new("Bright red"), hit.Parent.Torso.CFrame * cn(0, 0, 0) * angles(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 15, 1, 0, 5, 0, 0.02)
end
Humanoid.Health = Humanoid.Health + 10
end
elseif Type == "UpKnock" then
local hum = hit.Parent.Humanoid
hum.PlatformStand = true
if hum ~= nil then
hitr = true
end
coroutine.resume(coroutine.create(function(HHumanoid)
swait(5)
HHumanoid.PlatformStand = false
hitr = false
end), hum)
local bodyVelocity = Create("BodyVelocity")({
velocity = Vector3.new(0, 20, 0),
P = 5000,
maxForce = Vector3.new(8000, 8000, 8000),
Parent = hit
})
game:GetService("Debris"):AddItem(bodyVelocity, 0.5)
local bodyVelocity = Create("BodyVelocity")({
velocity = Vector3.new(0, 20, 0),
P = 5000,
maxForce = Vector3.new(8000, 8000, 8000),
Parent = hit
})
game:GetService("Debris"):AddItem(bodyVelocity, 1)
elseif Type == "Snare" then
local bp = Create("BodyPosition")({
P = 2000,
D = 100,
maxForce = Vector3.new(math.huge, math.huge, math.huge),
position = hit.Parent.Torso.Position,
Parent = hit.Parent.Torso
})
game:GetService("Debris"):AddItem(bp, 1)
elseif Type == "Slashnare" then
Effects.Block.Create(BrickColor.new("Pastel Blue"), hit.Parent.Torso.CFrame * cn(0, 0, 0), 15*4, 15*4, 15*4, 3*4, 3*4, 3*4, 0.07)
for i = 1, math.random(4, 5) do
Effects.Sphere.Create(BrickColor.new("Teal"), hit.Parent.Torso.CFrame * cn(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5)) * angles(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 15, 1, 0, 5, 0, 0.02)
end
local bp = Create("BodyPosition")({
P = 2000,
D = 100,
maxForce = Vector3.new(math.huge, math.huge, math.huge),
position = hit.Parent.Torso.Position,
Parent = hit.Parent.Torso
})
game:GetService("Debris"):AddItem(bp, 1)
elseif Type == "Spike" then
CreateBigIceSword(hit.Parent.Torso.CFrame)
local bp = Create("BodyPosition")({
P = 2000,
D = 100,
maxForce = Vector3.new(math.huge, math.huge, math.huge),
position = hit.Parent.Torso.Position,
Parent = hit.Parent.Torso
})
game:GetService("Debris"):AddItem(bp, 1)
elseif Type == "Freeze" then
local BodPos = Create("BodyPosition")({
P = 50000,
D = 1000,
maxForce = Vector3.new(math.huge, math.huge, math.huge),
position = hit.Parent.Torso.Position,
Parent = hit.Parent.Torso
})
local BodGy = Create("BodyGyro")({
maxTorque = Vector3.new(400000, 400000, 400000) * math.huge,
P = 20000,
Parent = hit.Parent.Torso,
cframe = hit.Parent.Torso.CFrame
})
hit.Parent.Torso.Anchored = true
coroutine.resume(coroutine.create(function(Part)
swait(1.5)
Part.Anchored = false
end), hit.Parent.Torso)
game:GetService("Debris"):AddItem(BodPos, 3)
game:GetService("Debris"):AddItem(BodGy, 3)
end
local debounce = Create("BoolValue")({
Name = "DebounceHit",
Parent = hit.Parent,
Value = true
})
game:GetService("Debris"):AddItem(debounce, Delay)
c = Instance.new("ObjectValue")
c.Name = "creator"
c.Value = Player
c.Parent = h
game:GetService("Debris"):AddItem(c, 0.5)
end
elseif DoDamage == false then
print("Damage is disabled")
end