So I have been using LUA for about a month now and I am still slightly new, but there is one thing I have not been able to figure out at all.
I coded an object that allows you to press USE and it will exchange whatever weapon you are currently holding with an upgraded one. I can’t figure out how to identify the held object.
if activator:GetActiveWeapon():Type("weapon_te3_glock17") then activator:Give("weapon_te3_upgraded_glock17") end
I know that isn’t the code but I have tried multiple others such as
if activator:GetActiveWeapon() == "weapon_te3_glock17" then activator:Give("weapon_te3_upgraded_glock17") end
Any help would be awesome!