addEventHandler("onClientResourceStart", resourceRoot,
function()
window = guiCreateWindow(266, 121, 184, 287, "Skin Panel", false)
guiWindowSetSizable(window, false)
gridlist = guiCreateGridList(9, 20, 165, 257, false, window)
column = guiGridListAddColumn(gridlist, "Skins", 0.9)
local row = guiGridListAddRow(gridlist)
guiGridListSetItemText(gridlist, row, column, "Punk", false, false)
button = guiCreateButton(23, 205, 121, 42, "SELECT", false, gridlist)
addEventHandler("onClientGUIClick", button, setTheSkin)
guiSetVisible(window, false)
end
)
function showTheGui()
local v = guiGetVisible( window )
guiSetVisible(window, not v )
showCursor(v)
end
addCommandHandler("opengui", showTheGui)
bindKey("F1", "down", showTheGui)
function setTheSkin(button, state)
if ( source == button ) and (button =="left") then
local row, col = guiGridListGetSelectedItem( gridlist )
local name = guiGridListGetItemText( gridlist , row, col)
if (row==-1) or (col==-1) then return end
if name == "Punk" then
setElementModel(localPlayer, 181)
end
end
end
addEventHandler("onClientGUIClick", root, setTheSkin)
Try this, didn't test but seems ok