I made car spawn script and i cant spawn car who can help me?
function openGUI()
window = guiCreateWindow (0.3,0.2,0.3,0.6,"SACR Car spawn",true)
gridlist = guiCreateGridList (0.1,0.1,0.8,0.7,true,window)
column = guiGridListAddColumn( gridlist, "Vehicles:", 0.85 )
row = guiGridListAddRow ( gridlist )
guiGridListSetItemText ( gridlist, row, column, "Patriot", false, false )
button = guiCreateButton (0.8,0.8,0.2,0.2,"Patriot",true,window)
close = guiCreateButton(0,0.85,0.45,0.1,"Close",true,window)
showCursor (true)
end
addEvent ("openGUI",true)
addEventHandler ("openGUI",getRootElement(getThisResource()),openGUI)
function destroyGUI()
destroyElement(window)
window = false
showCursor (false)
end
function buttonClick()
if source == row then
triggerServerEvent ("vehicle",getLocalPlayer())
destroyGUI ()
elseif source == close then
destroyGUI ()
end
end
addEventHandler("onClientGUIClick",getRootElement(),buttonClick)
Please help me!!