From f8b50d70bcfbe9f0a7d0b2b7294a2844455d136e Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Mon, 30 Dec 2024 12:07:07 +0300 Subject: [PATCH] Fix error (#3235) * Fix error * move lookupattachment --------- Co-authored-by: thegrb93 --- lua/weapons/laserpointer/cl_init.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/weapons/laserpointer/cl_init.lua b/lua/weapons/laserpointer/cl_init.lua index 9b6472cf75..adf984a6fd 100644 --- a/lua/weapons/laserpointer/cl_init.lua +++ b/lua/weapons/laserpointer/cl_init.lua @@ -22,8 +22,6 @@ function SWEP:Setup(ply) self.Attach = attachmentIndex end end - - self.WAttach = self:LookupAttachment("muzzle") end function SWEP:Initialize() @@ -45,7 +43,7 @@ function SWEP:DrawWorldModel() self:DrawModel() if self:GetLaserEnabled() then - local att = self:GetAttachment(self.WAttach) + local att = self:GetAttachment(self:LookupAttachment("muzzle") or 0) if not att then return end local owner = self:GetOwner()