Hello I've been making a GUI first time doing this and I've got the code to work but I've tried using a button to hide the GUI after it is clicked.
Can anyone help me, please?
-- Made by Jonty / First Lua code for Tables.
Skins = {
"Cj - 0",
"",
""
}
Vehicle = {
"",
""
}
function setupSkinSelection (theResource)
-- Creats GUI window
spawnScreenMenu = guiCreateWindow ( 0.15, 0.33, 0.7, 0.34, "Find the ID's you want!", true )
-- Button
spawnScreenOKButton = guiCreateButton ( 0.4, 0.85, 0.20, 0.15, "Done", true, spawnScreenMenu )
guiWindowSetMovable ( spawnScreenMenu, false )
guiWindowSetSizable ( spawnScreenMenu, false )
spawnScreenGridList = guiCreateGridList ( 0, 0.1, 1, 0.9, true, spawnScreenMenu )
guiGridListSetSelectionMode ( spawnScreenGridList, 2 )
guiGridListAddColumn ( spawnScreenGridList, "Skins", 0.3 )
guiGridListAddColumn ( spawnScreenGridList, "Vehicle", 0.3 )
for key,skinName in pairs(Skins) do
local row = guiGridListAddRow ( spawnScreenGridList )
guiGridListSetItemText ( spawnScreenGridList, row, 1, skinName, false, false )
end
-- Rows for the GUI window
row = 0
for key,skinName in pairs(Vehicle) do
guiGridListSetItemText ( spawnScreenGridList, row, 2, skinName, false, false )
row = row + 1
end
end
-- Command to launch the GUI
addCommandHandler('IDSelection',
function()
setupSkinSelection(true)
showCursor ( true )
end
)
addEventHandler('onClientGUIClick' , spawnScreenOKButton,
function ( )
if ( source == 'Done' ) then
guiSetVisible (spawnScreenMenu , false)
showCursor ( false )
end