ID:268171
 
for(var/obj/ores/Silver/A in src)
S += 1
if(!S)
usr<<"\icon[usr]Anvil:
Requirements: 3 Silver Ores"
usr<<"You do not have enough to make this!"
if(S >= 5)
usr<<"\icon[usr]Anvil:
Requirements: 3 Silver Ores"

It keeps on saying I do not have enough. I would really not like to use variables for this, but if I must I can... is there a simpler way of doing this without variables?
Kasumi Tomonari wrote:
if(S >= 5)

Could that be the problem? Your text output says you need three, but this says you need 5 or more.
Your logic is dodgy. If they have some ore, but not enough (say, they have 2) then nothing will happen. =) And, as DarkView mentioned, you're checking for 5 rather than 3. Try this:

<code>if(S >= 3) usr<<"\icon[usr]Anvil: Requirements: 3 Silver Ores" // Have them forge it here else usr << "\icon[usr]Anvil: Requirements: 3 Silver Ores" usr << "You do not have enough ore to make this!"</code>

As well as that, you're looping through src's contents, but you refer to the player as "usr" all the way through the rest of it. What is src in this case? Does the verb belong to the anvil or the player?