Hey, I am trying to make a Police Ammo Box that will sit inside a PD and when a player comes up to it and presses ‘E’ that player is given SMG1 ammo however when I use Player/GiveAmmo it wont give the player the ammo. The code I am using is;
--Police Ammo Box AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") function ENT:Initialize() self:SetModel("models/Items/ammocrate_smg1.mdl") self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_VPHYSICS) self:SetSolid(SOLID_VPHYSICS) local phys = self:GetPhysicsObject() if phys:IsValid() then phys:Wake() end end function ENT:Use(a , c) Player:GiveAmmo( 125, SMG1, true) end
Can someone please tell me why the ammo is never given. I do not get any errors and just am really confused… Help is greatly appreciated!