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~

5 comments
I did as you said and closed off that conditional but no errors occur and yet the magazines do not replenish.
Try directly changing MagazinesCarried instead of ammo?
I didn't think of that but I actually don't know how to. Is like MagazinesCarried = 1 + 1?
Oh I forgot to add in, the stringvalue which is the supposed "magazine" is actually in the player backpack so I would have to access the Player service
If you want to add 1 to a variable, you would do X = X + 1