I have one question and a problem
My question is:
When does a Parts NetworkOwnerShip change from nil to a Players NetworkOwnerShip and when does it change back?
My Problem is this Module Script:
local ApplyKnockback = {}
local KnockbackRemoteEvent = game.ReplicatedStorage.RemoteEvents.KnockbackRemoteEvent
function ApplyKnockback(EnemyHRP, AttackerHRP, UpwardsArc, KnockbackForce, TypeOfDirection, MakeEnemyFaceAttacker)
local Direction = nil
local EnemyMass = EnemyHRP.AssemblyMass
local LookVector = AttackerHRP.CFrame.LookVector
local EnemyPlayer = EnemyHRP:GetNetworkOwner()
print("Knockback ||| Attacker: ".. AttackerHRP.Parent.Name .. ". and Victim: " .. EnemyHRP.Parent.Name)
if not KnockbackForce then return end
if not UpwardsArc then UpwardsArc = 0 end
if TypeOfDirection == "Away" then
Direction = (EnemyHRP.Position - AttackerHRP.Position + Vector3.new(0, UpwardsArc, 0)).Unit
end
if TypeOfDirection == "Pull" then
Direction = (AttackerHRP.Position - EnemyHRP.Position + Vector3.new(0, UpwardsArc, 0)).Unit
end
if TypeOfDirection == "LookVector" then
Direction = Vector3.new(LookVector.X, UpwardsArc, LookVector.Z).Unit
end
if MakeEnemyFaceAttacker then
local LookDirection = Vector3.new(LookVector.X, 0, LookVector.Z).Unit
EnemyHRP.CFrame = CFrame.lookAt(EnemyHRP.Position, AttackerHRP.Position - LookDirection)
end
if EnemyPlayer then
print("HumanoidRootPartOwner: " .. EnemyHRP.Parent.Name .. ". and NetworkOwner: " .. EnemyPlayer.Name)
KnockbackRemoteEvent:FireClient(EnemyPlayer, Direction, EnemyMass, KnockbackForce)
print("Impulsing a player")
else
EnemyHRP:ApplyImpulse(Direction * EnemyMass * KnockbackForce)
end
end
return ApplyKnockback
** You are now Level 11! **