Jump to content

Choice Box Help


Slimwaffle
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...