ID:1629529
 
(See the best response by A.T.H.K.)
mob
Merchant
icon = 'SpecialClothingNPC.dmi'
icon_state = ""
name = "{NPC}SpecialClothier"
npc = 1
verb
Talk()
set category = "NPC's"
set src in oview(2)
switch(input("Yo sup, wanna buy some clothes?", text) in list ("Yes","No"))
if("Yes")
switch(input("What do you want to buy?", text) in list ("TobiMask","ArmGuards"))
if("TobiMask")
var/K = new/obj/TobiMask
K:loc = usr
usr << "<b>Have a nice day!"
if("Armguards")
var/K = new/obj/Armguards
K:loc = usr
usr << "<b>Have a nice day!"

//-------------------------------------------------------------------------------------------------


obj
TobiMask
name = "TobiMask"
icon = 'TobiMask.dmi'
verb
Wear()
if(src.worn)
src.worn = 0
usr.overlays -= src.icon
else
src.worn = 1
usr.overlays += src.icon
Drop()
if(src:worn == 1)
usr << "Not while its being worn."
if(src:worn == 0)
src.loc=locate(usr.x,usr.y-1,usr.z)
Get()
set src in oview(1)
src.loc = usr
usr<<"You picked up a [src]"


obj
ArmGuards
name = "ArmGuards"
icon = 'ArmGuards.dmi'
verb
Wear()
if(src.worn)
src.worn = 0
usr.overlays -= src.icon
else
src.worn = 1
usr.overlays += src.icon
Drop()
if(src:worn == 1)
usr << "Not while its being worn."
if(src:worn == 0)
src.loc=locate(usr.x,usr.y-1,usr.z)
Get()
set src in oview(1)
src.loc = usr
usr<<"You picked up a [src]"






<dm>



Why are these undefined vars? I keep getting these errors:

Clothing\Clothes.dm:313:error: npc: undefined var
Clothing\Clothes.dm:339:error: src.worn: undefined var
Clothing\Clothes.dm:340:error: src.worn: undefined var
Clothing\Clothes.dm:343:error: src.worn: undefined var
Clothing\Clothes.dm:346:error: src/:/worn: undefined var
Clothing\Clothes.dm:348:error: src/:/worn: undefined var
Clothing\Clothes.dm:362:error: src.worn: undefined var
Clothing\Clothes.dm:363:error: src.worn: undefined var
Clothing\Clothes.dm:366:error: src.worn: undefined var
Clothing\Clothes.dm:369:error: src/:/worn: undefined var
Clothing\Clothes.dm:371:error: src/:/worn: undefined var
Baruto.dmb - 11 errors, 0 warnings


Best response
Because they aren't defined anywhere..

mob/var
worn


Etc
I added

 mob/var
npc
<dm>

and now the npc var works, but I added:

mob/var
worn

the worn doesnt work and i get this:

Clothing\Clothes.dm:339:error: src.worn: undefined var
Clothing\Clothes.dm:340:error: src.worn: undefined var
Clothing\Clothes.dm:343:error: src.worn: undefined var
Clothing\Clothes.dm:346:error: src/:/worn: undefined var
Clothing\Clothes.dm:348:error: src/:/worn: undefined var
Clothing\Clothes.dm:362:error: src.worn: undefined var
Clothing\Clothes.dm:363:error: src.worn: undefined var
Clothing\Clothes.dm:366:error: src.worn: undefined var
Clothing\Clothes.dm:369:error: src/:/worn: undefined var
Clothing\Clothes.dm:371:error: src/:/worn: undefined var
Baruto.dmb - 10 errors, 0 warnings



is there a specific spot im supposed to put:

mob/var
worn
?
Don't .. copy and paste....
I apologize.... I thought that was what you gave the code to me for :/ what should i do otherwise? and do you think you could explain it to me just a little more? I have read the guide and im learning some stuff but im just not seeming to understand what I am doing wrong here.
You need to make the objs have the "worn" var. such as

obj/var
worn
You should also avoid using : and use . wherever possible.
alright thanks guys, it works now