not sure how to do a stun for when the victim is touching the players hitbox.
local connection
connection = hitbox.Touched:Connect(function(hit)
local other = hit:FindFirstAncestorOfClass("Model"):WaitForChild("Humanoid")
if not other then
print("Not a humanoid")
else
if hit:FindFirstAncestorOfClass("Model") ~= char then
hit:FindFirstAncestorOfClass("Model"):SetAttribute("Stunned", true)
other.Health -= 10
local bv = Instance.new("BodyVelocity")
bv.Parent = other:FindFirstAncestorOfClass("Model"):WaitForChild("HumanoidRootPart")
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bv.Velocity = hrp.CFrame.LookVector * force
bv.P = 1250
debris:AddItem(bv, 0.3)
task.delay(1, function()
end)
connection:Disconnect()
end
end
end)
debris:AddItem(hitbox, 0.5)
hitbox.TouchEnded:Connect(function(hit)
local other = hit:FindFirstAncestorOfClass("Model"):WaitForChild("Humanoid")
if not other then
print("Not a humanoid")
else
if hit:FindFirstAncestorOfClass("Model") ~= char then
hit:FindFirstAncestorOfClass("Model"):SetAttribute("Stunned", false)
end
end
end)
end)