• 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!

Lua Storage on time

PuzzeL

www.XERIA.pl Come! :D
Joined
Feb 7, 2010
Messages
62
Reaction score
3
Location
//Poland
Hi just needs a ruler, which is responsible for assigning storage who will run for x time.
 
The point here is that if you come to the grille, gives the storage, for x time.
It's just I can write but do not know how to storage was at x time

- - - Updated - - -

That's my only add to the storage time
Lua:
function onStepIn(cid, item, position, fromPosition)
local storage = x
local pos = y
	doCreatureSetStorage(cid,7328,1)
doTeleportThing(cid, poss)
end
 
Set the storage to os.time()+valid_time, like this:
Lua:
local valid_time = 60    -- storage is valid for 1 minute (60 seconds)
doCreatureSetStorage(cid, 7328, os.time()+valid_time)

Now if you want to check if the storage is still valid do it like this:

Lua:
local storageValue = getCreatureStorage(cid, 7328)
if storageValue >= os.time() then
    -- storage is still valid.
else
    -- storage has run out
end
 
Back
Top