I'm trying to make a medic job, however I got stuck within this, for the event and the takeButton they are already defined but I don't want to put my script here.
WARNING: [CPG]emergency\medic_client.lua:105: Bad arguement @ 'addEventHandler' [Expected element at arguement 2, got nil]
addEventHandler("onClientGUIClick", takeButton,
function()
if (guiGridListGetSelectedItem(GUIEditor.gridlist[1]) == skin1) and not getElementData(localPlayer, "Occupation") == "Paramedic" then
triggerServerEvent("takeJobAs274", localPlayer)
triggerEvent("closeMedicWindow", root)
exports.DxChat:sayClientMessage("You're now employed as paramedic!", 0, 255, 0)
elseif (guiGridListGetSelectedItem(GUIEditor.gridlist[1]) == skin2) and not getElementData(localPlayer, "Occupation") == "Paramedic" then
triggerServerEvent("takeJobAs275", localPlayer)
triggerEvent("closeMedicWindow", root)
exports.DxChat:sayClientMessage("You're now employed as paramedic!", 0, 255, 0)
elseif (guiGridListGetSelectedItem(GUIEditor.gridlist[1]) == skin3) and not getElementData(localPlayer, "Occupation") == "Paramedic" then
triggerServerEvent("takeJobAs276", localPlayer)
exports.DxChat:sayClientMessage("You're now employed as paramedic!", 0, 255, 0)
triggerEvent("closeMedicWindow", root)
elseif source == takeButton and getElementData(localPlayer, "Occupation") == "Paramedic" then
exports.DxChat:sayClientMessage("Your job is already paramedic!", 255, 0, 0)
end
end
)