-
What do you want to achieve? Keep it simple and clear!
i want to make a clean knockback system with this script -
What is the issue? Include screenshots / videos if possible!
there is a strange delay that happens on the knockback m1 (the fifth one)
https://i.gyazo.com/0def3fc1da38669f2c0821150392034a.mp4 -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i tried changing the network ownership to server and player, and i still get this delay
hitbox.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= player.Name then
local enemyhum = hit.Parent:FindFirstChild("Humanoid")
enemyhum:TakeDamage(1)
hitbox:Destroy()
weld:Destroy()
local particles = combatstuff.Particles:Clone()
particles.Parent = hit.Parent.HumanoidRootPart
particles.CFrame = hit.Parent.HumanoidRootPart.CFrame
particles.Attachment.circle:Emit(1)
particles.Attachment.burst:Emit(20)
debris:AddItem(particles,1)
local function npcRagdoll(num)
if count == 5 then
if num == 0 then
hit.Parent:FindFirstChild("RagdollTrigger").Value = true
local bv = Instance.new("VectorForce")
bv.Name = "Bv"
bv.Parent = hit.Parent:FindFirstChild("HumanoidRootPart")
bv.ApplyAtCenterOfMass = true
local atc = Instance.new("Attachment")
atc.Name = "Atc"
atc.Parent = hit.Parent:FindFirstChild("HumanoidRootPart")
atc.CFrame = hit.Parent:FindFirstChild("HumanoidRootPart").CFrame * CFrame.new(0,0,-2)
bv.Attachment0 = atc
bv.RelativeTo = rps.VectorForce.RelativeTo
bv.Force = player.Character.HumanoidRootPart.CFrame.LookVector * 1000
bv.Force = Vector3.new(bv.Force.X,0,bv.Force.Z)
end
if num == 1 then
hit.Parent:FindFirstChild("RagdollTrigger").Value = false
hit.Parent.HumanoidRootPart:FindFirstChild("Bv"):Destroy()
hit.Parent.HumanoidRootPart:FindFirstChild("Atc"):Destroy()
end
end
end
npcRagdoll(0)
wait(1)
npcRagdoll(1)
end
end)