robod Posted February 10, 2018 Share Posted February 10, 2018 Hello, I have this code: function click ( button, state, sx, sy, x, y, z, elem, gui ) local teamName local menu teamName = "spies" menu = spiesMenu primarySelection = getSelectedWeapon ( teamName, "primary" ) secondarySelection = getSelectedWeapon ( teamName, "secondary" ) throwableSelection = getSelectedWeapon ( teamName, "throwable" ) specialSection = getSelectedWeapon ( teamName, "special" ) if primarySelection then outputChatBox ( primarySelection ) end if secondarySelection then outputChatBox ( secondarySelection ) end end function getSelectedWeapon ( teamName, category ) if teamName ~= "mercenaries" and teamName ~= "spies" then return false end if retrieveGridList[teamName][category] == nil then return false end local gridList = retrieveGridList[teamName][category] local row = guiGridListGetSelectedItem ( gridList ) if row == -1 then return false end selectedWeapon = guiGridListGetItemText ( gridList, row, 1 ) return selectedWeapon end and I have 4 gridlists in one GUI. How can I output just one selected item from one gridlist item I select? Now it outputs every item selected from each gridlist. Link to comment
DNL291 Posted February 10, 2018 Share Posted February 10, 2018 Is the function "click" attached to the "onClientClick" event? Try debugging the code using outputChatBox and see what each value shows. It's hard to figure out what's wrong just by looking at that piece of code. It would be better if you posted all code of the gridList. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now