Apparently the attack I made has a knockback delay for the user but on the victim the knockback looks perfectly fine and I have no idea why. Im using client bodymovers and network ownership whether if it was set to the player or nil neither worked the way I needed and still had some sort of delay or didn’t move at all.
-- on server
Leg_Hitbox.Touched:Connect(function(hit)
if hit:IsA("BasePart") or hit:IsA("MeshPart") then
if not beenhit[hit.Parent] and hit.Parent.Name ~= Char.Name and not hit:IsDescendantOf(Char) and hit.Parent:FindFirstChild("Humanoid") then
beenhit[hit.Parent] = true
hit.Parent.HumanoidRootPart.CFrame = CFrame.new(hit.Parent.HumanoidRootPart.Position,HumRT.Position)
spawn(function()
Debris.rsWait(1)
beenhit[hit.Parent] = false
end)
spawn(function()
if not game.Players:GetPlayerFromCharacter(hit.Parent) then
hit.Parent.HumanoidRootPart:SetNetworkOwner(Player)
local velo = Instance.new("BodyVelocity",hit.Parent.HumanoidRootPart)
velo.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
velo.Velocity = Char.HumanoidRootPart.CFrame.LookVector * 90
print("An NPC")
wait(2)
velo:Destroy()
hit.Parent.HumanoidRootPart:SetNetworkOwner(nil)
else
print("A player")
PikaKickRemote:FireAllClients("Hit",Char,Models,hit)
end
end)
local OOF = Instance.new("Animation")
OOF.AnimationId = "rbxassetid://7048331285"
local Impact = hit.Parent.Humanoid:LoadAnimation(OOF)
Impact:Play()
hit.Parent.Humanoid:TakeDamage(Damage)
end
end
end)
--on client
PikaKickRemote.OnClientEvent:Connect(function(Type,Char,Models,Target)
if Type == "StartUpEffects" then
StartUp(Char,Models)
elseif Type == "Hit" then
BeenHit(Target,Char)
end
end)
function BeenHit(Target,Char)
local velo = Instance.new("BodyVelocity",Target.Parent.HumanoidRootPart)
velo.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
velo.Velocity = Char.HumanoidRootPart.CFrame.LookVector * 90
print("RECIEVED")
wait(2)
velo:Destroy()
end