ID:1632241
 
Code:
 mob
SpecialClothesGuy
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","MadaraRobe","RinneganTobiMask"))
if("TobiMask")
var/K = new/obj/TobiMask
K:loc = usr
usr << "<b>Have a nice day!"
if("RinneganTobiMask")
var/K = new/obj/RinneganTobiMask
K:loc = usr
usr << "<b>Have a nice day!"
if("MadaraRobe")
var/K = new/obj/MadaraRobe
K:loc = usr
usr << "<b>Have a nice day!"


Problem description:
Everything works except the Madara Robe, when i compile it says that "if("MadaraRobe") is an inconsistent indentation. Why?
Everything is weird..

Try using the 'tab' key to properly line out your code.
In response to Laser50
Laser50 wrote:
Everything is weird..

Try using the 'tab' key to properly line out your code.

He kinda Spaced out the if statements.
You should start backing the if("yes") and switch as well but keep the others at the same.
plus set src in oview(2) Hmm i got confused in that one.
Original Version:
mob
SpecialClothesGuy
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","MadaraRobe","RinneganTobiMask"))
if("TobiMask")
var/K = new/obj/TobiMask
K:loc = usr
usr << "<b>Have a nice day!"
if("RinneganTobiMask")
var/K = new/obj/RinneganTobiMask
K:loc = usr
usr << "<b>Have a nice day!"
if("MadaraRobe")
var/K = new/obj/MadaraRobe
K:loc = usr
usr << "<b>Have a nice day!"



Revised Version: (Warning: I've not compiled this.)
/mob/SpecialClothesGuy
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", "MadaraRobe", "RinneganTobiMask"))
if ("TobiMask") new /obj/TobiMask(usr) // When making a new object, you can define the
if ("RinneganTobiMask") new /obj/RinneganTobiMask(usr) // location like seen here. This causes
if ("MadaraRobe") new /obj/MadaraRobe(usr) // it to spawn in the 'usr'.
usr << "<b>Have a nice day!" // This will run no matter what the player buys.
if ("No")
// Do whatever you want here. Probably end the convo.


Compare the two. In the latter, the spacing is constant on every new line for each set of instructions. In the former, it is irregular. Inconsistent spacing means irregular spacing. For everything within a 'block', you need to have some new, regular space. I used four in my 'revised' example because it tends to be the standard insofar as I have seen.

Best way I could recommend to ensure proper spacing in the future is to use the tab key instead of... whatever method you were using.