SWEP.Deploy being called before SWEP is initialized?
1 replies, posted
For some reason, I can't access self.Owner in the deploy hook. Anyone have any guesses why?
[lua]function SWEP:Deploy()
if( SERVER ) then
self.Owner:DrawWorldModel( false );
self.Owner:DrawViewModel( true );
self.Attach = ents.Create( "hls_weaponattach" );
self.Attach:SetModel( self.WorldModel );
self.Attach:Spawn();
self.Attach:SetPlayer( self.Owner, self.PBone, self.POff, self.PAng, self.PScale );
end
self.Owner:SetFOV( 90, 0 );
self:DoClAnim( ACT_VM_DRAW );
self.NextWeaponIdle = CurTime() + self:SequenceDuration();
end[/lua]
[lua]self.Owner:DrawWorldModel( false );[/lua]
The above code is saying self.Owner doesn't exist. Also tried a debug message that told me at the beginning of the hook, self.Owner is NULL.
It's not set until like a frame later.
Sorry, you need to Log In to post a reply to this thread.