ID:1923986
 
(See the best response by Ter13.)
Code:
mob
Login()
src.home_village = input ("Which village are you from?") in list ("Avilla","Bvilla")
if("Avilla")
usr << "Those from Avilla are born with increased strength."
usr.Str += 5
else if("Bvilla")
usr << "Those from Bvilla are born with increased defence."
usr.Def += 5
var
home_village = " "
Str = 10
Def = 10
Problem description:

I have this problem when making a player choose his village for my demo game.
when i compile there aren't any errors but when i run and try to exucute this for a player from bvilla it gives them the avilla option.
how can i fix this should i try a different way to enter the lines which says:src.home_village = input ("Which village are you from?") in list ("Avilla","Bvilla")
or make vars for the villages?
don't mind the indentation
Put your code between DM tags:

<DM>
CODE GOES HERE
</DM>
Best response
Also, the problem is that your if statement doesn't have a left-hand label that is being checked against. if("somestring") is always true because "somestring" is not 0 or null. You can fix this two ways. One is to use a switch statement:

home_village = input ("Which village are you from?") in list ("Avilla","Bvilla")
switch(home_village)
if("Avilla")
//do stuff for AVilla
if("Bvilla")
//do stuff for BVilla


Or you can supply the left hand labels in an if/else chain.

home_village = input ("Which village are you from?") in list("Avilla","Bvilla")
if(home_village=="Avilla")
//do stuff for AVilla
else if(home_village=="Bvilla")
//do stuff for BVilla


IMO, the switch statement is the better solution.
sure thanks