Hello FP.
i want it to do so if you are holding a ak47 in your hand and type holster in console it’s remove the ak47 and add it to my inventory addon, but can’t get the if to work.
Code:
function TypeHolster( activator, caller )
if Player:GetActiveWeapon() == "weapon_mad_ak47" then
// Add the item to the inventory
activator:GiveItem("weapon_mad_ak47", 1);
// Play Sound
activator:EmitSound("items/ammocrate_open.wav");
// Remove Weapon From Player
activator:StripWeapon("weapon_mad_ak47")
end
end
concommand.Add("holster", TypeHolster)
Error:
[lua\autorun\ia_holster.lua:4] attempt to index global 'Player' (a function value)