0 votes
by (880 points)

Im using an if statement to get the players race, then if its a specific race like human, then it spits out two buttons that are labeled male or female.

<<if $playerSpecies =="Human">>
	<<button "Male" "part5">>...<</button>>
	<<button "Female" "part5">>...<</button>>
<<elseif $playerSpecies =="Elf" >>
	<<button "Male" "part5">>...<</button>>
	<<button "Female" "part5">>...<</button>>
<<elseif $playerSpecies =="Orc"  >>
	<<button "Male" "part5">>...<</button>>
	<<button "Female" "part5">>...<</button>>
<<else>>
	<<button "Male" "part5">>...<</button>>
	<<button "Female" "part5">>...<</button>>
<</if>>

 

1 Answer

+2 votes
by (159k points)
selected by
 
Best answer
You have supplied an explanation of what you are doing, but didn't include an actual question?
by (880 points)
Oh, I forgot. I meant to say it's spitting out an error so I was wondering if I was doing it right.
by (159k points)

I placed your example in a new SugarCube 2.x project, I created a part5 Passage, and then set the $playerSpecies story variable to each of the following values "Human", "Elf", "Orc", and "abc" in turn to test it. Each time the correct set of "Male" & "Female" buttons were displayed and there were no errors.

Without more information about the error messages themselves and when exactly they occurred it is almost impossible for us to determine why you got them.

by (880 points)
I got it, I forgot the quotes for "male" and "female"
...