settings = {}
local onSettingsRefresh

addEventHandler("onClientResourceStart", resourceRoot, function () 
    local resourceSettingsElement =  getElementChildren( getResourceDynamicElementRoot(getThisResource()), "resourceSettings")[1]
    settings = getElementData(resourceSettingsElement, "settings")
    if type(settings) ~= "table" then
        settings = {}
    end
    addEventHandler("onClientElementDataChange", resourceSettingsElement, onSettingsRefresh, false)
end, false, "high+100")


function onSettingsRefresh (theKey, oldValue, newValue) 
    if theKey == "settings" then
        settings = newValue
    end
end

