I tried calling a function which would add to the "MagazinesCarried" of the gun's script however, the script does not rely on separate values that are in the tool. Instead it uses this
local MagazinesCarried = 1
That starts out the gun with one mag but I have a means of storage/collection in which players can retrieve and relocate a magazine which is actually a stringvalue named "DMRMag". The function I mentioned earlier is supposed to check the player's backpack for that stringvalue and add 1 to the current 'MagazinesCarried' . The code below is the actual function
function magUp() local ammo = MagazinesCarried local mag = tool.Parent.Backpack:FindFirstChild("DMRMag") --I have to go into game.Players.'WhoeverIsUsingTheGun'.Backpack but I lack the knowledge to do that. Help? if mag == true then if ammo >= 1 then ammo = 1 + 1 mag:remove() end~
You have to add an end
after end~
and remove the extra symbol. You need to close off the conditional that you started on line 4.