Error:
[ERROR] lua/weapons/csgo_baseknif.lua:384: attempt to call field 'Create' (a nil value)
1. ThrowKnife - lua/weapons/csgo_baseknif.lua:384
2. unknown - lua/weapons/csgo_baseknif.lua:228
Source:
function SWEP:ThrowKnife()
local ent = ents.Create("mu_csgo") -- Line 384
ent:SetOwner(self.Owner)
ent:SetPos(self.Owner:GetShootPos())
ent:SetVar('skin', self.Skin)
local knife_ang = Angle(-28,0,0) + self.Owner:EyeAngles()
knife_ang:RotateAroundAxis(knife_ang:Right(), -90)
ent:SetAngles(knife_ang)
ent:Spawn()
local phys = ent:GetPhysicsObject()
phys:SetVelocity(self.Owner:GetAimVector() * (1 * 1000 + 200))
phys:AddAngleVelocity(Vector(0, 1500, 0))
self:Remove()
end
Line 228 is the calliong of ThrowKnife
You're most likely calling ThrowKnife on the client-side where ents.Create does not exist. Run it on the server
Thanks, got it working now!
Sorry, you need to Log In to post a reply to this thread.