View Single Post
  #1  
Old 04-28-2009, 01:51 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
GUI textlist problem.

I'm a bit new to GS2, but i managed to make a GUI that pops up, gives the player a list of options, which the player clicks, then clicks the button that applies the selection and closes the window.

Inside the script telling the apply button to check what was selected, i basically use the following setup:
if(){}
else if () {}
else if () {}
else if () {}
etc.

however, it seems that no matter what i select, it always chooses whatever the last if(){} on the list was.

for examle If the setup is the following:
if(){}//line 1
if(){}//line 2
if(){}//line 3
if(){}//line 4

then whatever i select will be whatever is on line 4.

HOWEVER, if the setup is like this:
if(){}//line 1
else if(){}//line 2
else if(){}//line 3
else if(){}//line 4

then no matter what option is chosen, the NPC will always use whatever is on line 1.

has the "else" feature changed in GS2 or something?

EDIT: Maybe "GUI textlist problem" was the wrong name to call the thread, but any help would still be greatly appreciated.
Reply With Quote