I am making a SWEP. All I want it to do right now is change the viewmodel position when I right click. For some reason, the variable “test” does not change in the if statement in SWEP:SecondaryAttack().
The viewmodel’s position doesn’t change either.
Someone please help, it is starting to fuck with me.
local test = Vector(0,0,0) function SWEP:SecondaryAttack() if (self:GetOwner():KeyPressed(IN_ATTACK2) && !aiming) then aiming = true test = Vector(1,0,0) elseif (self:GetOwner():KeyPressed(IN_ATTACK2) && aiming)then aiming = false test= Vector(100,0,0) end end function SWEP:GetViewModelPosition( pos, ang ) pos = pos + test return pos, ang end
All of the rest of my SWEP is working correctly, just this is frustrating me.