So I have a weapon that disarms the player it shoots at but because this is TTT, there are some weapons that I do not want to be removed when the player is shot. My current way of doing it removes all weapons and then gives the default TTT weapons back but it causes an issue where people can pickup multiple primary weapons, which obviously shouldn’t happen.
Ply in this case would be the trace entity that is declared in the Primary Attack function.
function SWEP:WeaponHandler(ply) for k, v in pairs(ply:GetWeapons()) do print(v) ply:DropWeapon(v) ply:Give("weapon_zm_improvised") ply:Give("weapon_zm_carry") ply:Give("weapon_ttt_unarmed") end end
So my question is can I make it so that the player only drops “v” if “v” is not equal to a certain group of entities. I could not get it to work for the life of me
This is what happens when I print “v” and those are the weapon entities.
Weapon [weapon_zm_improvised] Weapon [weapon_zm_carry] Weapon [weapon_ttt_unarmed]