Jump to content

Doesn't work (GUI Problem)


Recommended Posts

It won't open GUI. + Its the first time I'm trying to do Grid List, so if I did something wrong, please fix it. Thanks

client:

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(523, 209, 324, 347, "Skin", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(9, 23, 303, 272, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin", 0.9) 
        guiGridListAddRow(GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "a", false, false) 
        GUIEditor.button[1] = guiCreateButton(113, 300, 103, 37, "Select", false, GUIEditor.window[1])     
    end 
) 
  
addCommandHandler("open", 
function() 
guiSetVisible(GUIEditor.window[1], true) 
end 
) 
  
function setSkin() 
if ( source == GUIEditor.button[1] ) then 
    local row, col = guiGridListGetSelectedItem( GUIEditor.gridlist[1] ) 
    local name = guiGridListGetItemText( GUIEditor.gridlist[1], row, col) 
    if name == "a" then 
    setElementModel(source, 280) 
end 
end 
addEventHandler("onClientGUIClick", root, setSkin) 

Link to comment
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(523, 209, 324, 347, "Skin", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible ( GUIEditor.window[1], false ) 
         
        GUIEditor.gridlist[1] = guiCreateGridList(9, 23, 303, 272, false, GUIEditor.window[1]) 
        column = guiGridListAddColumn(GUIEditor.gridlist[1], "Skin", 0.9) 
        guiGridListAddRow(GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "a", false, false) 
        GUIEditor.button[1] = guiCreateButton(113, 300, 103, 37, "Select", false, GUIEditor.window[1])     
    end 
) 
  
addCommandHandler("open", 
function() 
guiSetVisible(GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) 
showCursor ( not isCursorShowing ( ) ) 
end 
) 
  
function setSkin() 
if ( source == GUIEditor.button[1] ) then 
    local row = guiGridListGetSelectedItem( GUIEditor.gridlist[1] ) 
    local name = guiGridListGetItemText( GUIEditor.gridlist[1], row, column ) 
    if name == "a" then 
        setElementModel(localPlayer, 280) 
    end 
end 
end 
addEventHandler("onClientGUIClick", resourceRoot, setSkin) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...