This time I'm trying to loop through all the obj's in the world, and find out what the "amount" is. Here is the code...
mob/verb
CheckObjects()
for(var/obj/S in world)
usr<<"There are [S.amount] [S]"
obj/var
amount
obj
Apples
amount = 1000
<dm>
All help is appreaciated.
<code>var/combined = 0 for(var/obj/apple/A in world) combined += A.amount usr << "[combined] apples total"</code>
Find the total amount of apple objects in the world?
<code>var/total = 0 for(var/obj/apple/A in world) total++ usr << "[total] apples in the world"</code>
Or what? If you just want to look through all the apples in the world and see what their amount is, I see nothing wrong with the code you've got.