Stupid question here



function SWEP:PrimaryAttack()


    self:EmitSound( ShootSound )
    self:ShootEffects( self )


    if(SERVER)then
        timer.Simple(1, function()
            self.Owner:DrawWorldModel(false)
            self.Owner:DrawViewModel(false)
            self.Owner:SetRenderMode(RENDERMODE_TRANSALPHA)
            self.Owner:SetColor(Color(0,0,0,0))
            timer.Simple(30, function()
                self.Owner:SetRenderMode(RENDERMODE_NONE)
                self.Owner:DrawWorldModel(true)
                self.Owner:DrawViewModel(true)
            end)
        end)
    end


    
    if (!SERVER) then return end
    
end


This code WORKS when you have the SWEP out. but I am going to make it remove after use, so that you can use other weapons. This code also works for other weapons but the problem is when it is HERE and I change to another weapon it stops functioning. I am having a brain fart…

You scripted it into a SWEP and use self:SomeFunc() then no wonder it’s working on SELF.

think hook, networked variable, playerspawn hook to reset it, and a concommand to enable it. none of it in a swep. you could have a swep call the function or run the command, but you need it outside the swep code (or at least a global function inside the swep code