globalStorages = {}
function getGlobalStorageValue(key)
local storage = globalStorages[key]
if not storage then return -1 end
return storage
end
function setGlobalStorageValue(key, value)
globalStorages[key] = value
return true
end
Hi,Mark it as solved. If its not solved add this to your global.lua
Code:globalStorages = {} function getGlobalStorageValue(key) local storage = globalStorages[key] if not storage then return -1 end return storage end function setGlobalStorageValue(key, value) globalStorages[key] = value return true end
Always nice to post the solution for others.
onStartup
and onShutdown
to save and load the storages values.Always nice to post the solution for others.
That's on purpose, so if you do do this, you need to provide a mechanism to configure retaining ranges that are ephemeral and ones that are persisted.The storages will disappear when server shutdown