turf/obj/anvil
icon = 'OBJ.dmi'
icon_state = "anvil"
layer=4
density=1
verb
Smith()
set src in oview(1)
var/obj/Items/Smith/Hammer = locate(/obj/Items/Smith/Hammer) in usr.contents
if(Hammer)
var/smithing = input("What would you like to create?","SMITH MENU")in list("Iron Sword","Cancel")
if(smithing == "Iron Sword")
// for(var/obj/Items/Smith/I in src.contents)
// if(istype(I, ironitemType))
var/obj/Items/Smith/Iron_Bar = locate(/obj/Items/Smith/Iron_Bar) in usr.contents
if(Iron_Bar)
if(Iron_Bar>=5)
Smithstart
src.contents.Remove(Iron_Bar)
del(Iron_Bar)
ironswordhowMany -= 1
if(ironswordhowMany <= 0)
usr.contents+=new/obj/Items/equipment/arms/right/Iron_Sword
usr << "<font size=1><font color=green>You smith an Iron Sword!"
return
else
goto Smithstart
// break
else
usr << "<font size=1><font color=yellow>You need 5 iron bars to make an Iron Sword!"
return
else
usr << "<font size=1><font color=yellow>You need a hammer to start smithing!"
return
Problem description:
For some reason this won't work. Can anyone direct me on what I did wrong?
The things I see wrong.
1) you need to fix your indents.
2) if(istype(I, ironitemType))
What is this? I believe it should be..
if(istype(I,/obj/items/Iron))
3) Also; why the heck do you have /turf/obj? If you want to make it an obj, just do /obj/