Closed steadyfield closed 1 year ago
if error from client, then try
if not _CLIENT then
--code
end
Hi @steadyfield, weapon_hl2mpbase_scriptedweapon
is intended to be inherited from for when you create your own scripted weapons.
Is there a stack trace you can share with us, or is the error one line only?
if error from client, then try
if not _CLIENT then --code end
Thanks, this is exactly the solution of the error message. The issue is solved.
Hi @steadyfield,
weapon_hl2mpbase_scriptedweapon
is intended to be inherited from for when you create your own scripted weapons.Is there a stack trace you can share with us, or is the error one line only?
Thank you. As is pointed out by @Dim1xs , the solution is to add
if not _CLIENT then --code end
in SWEP:PrimaryAttack()
and SWEP:SecondaryAttack()
functions.
Thanks anyway.
give weapon_hl2mpbase_scriptedweapon
, as the player shoots the weapon, in console there is an error message:attempt to index a number value
so I opened the related SWEP lua files, and found that:local pPlayer = self:GetOwner();
calling any function ofpPlayer
, for example,pPlayer:DoMuzzleFlash(); or pPlayer:FireBullets( info );
will cause the an error message to be shown in console attempt to index a number valueI think the error is an issue with hl2sb's lua api, but idk how to fix it.