Slimwaffle Posted July 13, 2018 Share Posted July 13, 2018 I was wondering if someone could please help. How do I add an if condition to say "if choice box text = to an item in mitem{}, then the current selected table index[] is__" So that later on in my code I can say if trash button is pressed selected index is = to selected index -1 --Material Item List mitem ={} mitem[0] = "Wood" mitem[1] = "Steel" mitem[2] = "Concrete" mitem[3] = "Rubber" mitem.icount = {} mitem.icount[0] = 100 mitem.icount[1] = 200 mitem.icount[2] = 300 mitem.icount[3] = 400 for i=0, #mitem do local selected=false GameMenu.materials:AddItem( mitem .." = "..mitem.icount) end GameMenu.trashmat = Widget:Button("Trash",250,y,72,30,ipanel) y=y+sep Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.