• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Tasks stroage

Simplest way to reset every single player's storage value is to use a global table which is indexed by their id, this way you can easily reset all the players at once with 1 call.

Example
Code:
globalStorage = {}

function setPlayerGlobalStorage(cid, value)
    globalStorage[cid] = value
end

function resetPlayerGlobalStorage()
    globalStorage = nil
end

function getPlayerGlobalStorage(cid)
    return globalStorage[cid]
end
 
Simplest way to reset every single player's storage value is to use a global table which is indexed by their id, this way you can easily reset all the players at once with 1 call.

Example
Code:
globalStorage = {}

function setPlayerGlobalStorage(cid, value)
    globalStorage[cid] = value
end

function resetPlayerGlobalStorage()
    globalStorage = nil
end

function getPlayerGlobalStorage(cid)
    return globalStorage[cid]
end
Sorry, i can't understand, i'm still beginner with lua.
 
Back
Top