Global variable UpgradeResource (text) = "Wood" (or whatever is required for a level)
Global variable NeededResources (number) = required amount
Add all the resources as keys to an dictionary, assign values, and update them while gathering resources.
Now you can ...
Dictionary > Compare value > Key = UpgradeResource ... > .. Value = NeededResources
__________action ... level up
That, ofcourse, works fine until you need more 'NeededResources' to level up. At one point you could feel the need to level up when there is 500 wood and 1200 iron gathered.
Then you come back, and i will advise you to not use that logic that you so really want to use at this point. Just bring it all in 1 array.
Alternative. You can make a global for each resource, holding whats needed to upgrading.
Global 'wood' = 20
Global 'iron' = 0
Global 'meat' = 55
Using a dictionary .....
Dictionary > Compare value > Key = "wood" (a string) ... > .. Value = 'wood' (the global) - 1
Dictionary > Compare value > Key = "iron" ... > .. Value = 'iron' - 1
Dictionary > Compare value > Key = "meat" ... > .. Value = 'meat' - 1
_______actions whatever you want to do to perform a level up
Arrays & Dictionaries are just, and not more then, a variable holding more values. You should not shy away from them.
You will need them for 100 % sure at one point. Can as well start using now in a not to complicated logic.
Want to stay with the concept of globals. No problem. Just cant do that logic that you so weirdly want to do.
1 for each resource, holding whats needed to upgrading.
Global 'LvUwood' = 20
Global 'LvUiron' = 0
Global 'LvUmeat' = 55
1 for each current gatherd resource.
Global 'CuRwood' = updating while gathering
Global 'CuRiron' = updating while gathering
Global 'CuRmeat' = updating while gathering
System compare 2 values > 'Curwood' > 'LvUwood' -1
System compare 2 values > 'CuRiron' > 'LvUiron' -1
System compare 2 values > 'CuRmeat' > 'LvUmeat' -1
_____________Actions .... level up