frakStorage
local returnedValue = exports["RiP-Fraktion"]:frakStorage(fraktion, action, data)
Edit and save the fraction storage
Arguments
Name | Type | Optional | Explenation |
---|---|---|---|
fraktion | String | No | Fraction name |
action | String | No | 'add' or 'remove' |
data | Object | No | Data object |
Data Arguments
Name | Type | Optional | Explenation |
---|---|---|---|
name | String | No | Item name |
type | String | No | 'item' or 'weapon' |
amount | Integer | No | Amount of items |
label | String | Yes | Item label |
Returned Value
If the function was successful it will return the new fraction storage table. Otherwise it will return false
with an error notify or print.
Example
local storage = exports["RiP-Fraktion"]:frakStorage('rip', 'add', { name='water', type='item', amount=1 })
if storage then
print("item successfully added")
end