Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pStorage
- local pSave
- local api = {}
- function api.loadValue(key)
- return pStorage.data[key]
- end
- function api.saveValue(key, value)
- pStorage.data[key] = value
- pSave()
- end
- return {
- name = "database",
- api = api,
- onInitPersistentStorage = function(_pStorage, _pSave)
- pStorage = _pStorage
- if not pStorage.data then
- pStorage.data = {}
- end
- pSave = _pSave
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement