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

reseting storage in action script

Pokurwieniec

New Member
Joined
Feb 1, 2016
Messages
43
Reaction score
1
guys I need help
I have in npc storage for 1 minute:
Code:
doPlayerSetStorageValue(cid, 17543, os.time() + 1 * 60)
and here is check if already have
Code:
(getPlayerStorageValue(cid, 17543) > os.time())

working fine but how to implement this to action script onuse
Code:
(getPlayerStorageValue(cid, 17543) == 1)
- teleporting fine but after 1 minute it still teleporting so storage is not removed

even with
Code:
getPlayerStorageValue(cid,17543) == -1  then doCreatureSay(cid,"too late.")

what's wrong?
 
https://otland.net/threads/234306/page-1#post-2259639
Check the 'How storage values work'.

But generally your setting the storage value to a very long number like
20160308235226
And then checking if that number is equal to 1.
Of course it does not equal 1, so it doesn't work.

More or less we need more information on what your trying to do with the script, before we can accurately tell you how it could/should look like.
 
Alright, let me more specific.
We need to know what your trying to accomplish in all your scripts, or we are simply guessing at a solution.

My TFS is ._._._.
My script is supposed to do this.
This is what it is doing. - DONE
Here is the error's I am receiving.
Here is my scripts.
 
When you set a storage with a value in this case time.
Code:
local time_to_store = os.time() + 1 * 60
doPlayerSetStorageValue(cid, 17543, time_to_store)

Both of these will return false
Code:
(getPlayerStorageValue(cid, 17543) == 1) -- returns false
getPlayerStorageValue(cid, 17543) == -1  then doCreatureSay(cid,"too late.") -- returns false

Why is this the case?
It is because the storage value 17543 it still referencing the value that was assigned to it stored in time_to_store.

You need to change the value that 17543 is referencing, the only reason a storage will be -1 is if A you set it to -1 or B it was never assigned a value for the player as -1 is the default value of a storage.
 
Last edited:
Hehehe guys i mean that storage for 1 minute working in npc script but doesn't work with action script
so while storage is removed in npc script is fine but when that storage is in action script it doesn't have influence
so npc gives you a storage 17543 that have 1 minute to use some object but after 1 minute I still can use this object but I shouldn't even with this in script
Code:
(getPlayerStorageValue(cid, 17543) > os.time())
 
Hehehe guys i mean that storage for 1 minute working in npc script but doesn't work with action script
so while storage is removed in npc script is fine but when that storage is in action script it doesn't have influence
so npc gives you a storage 17543 that have 1 minute to use some object but after 1 minute I still can use this object but I shouldn't even with this in script
Code:
(getPlayerStorageValue(cid, 17543) > os.time())
we already answered you and gave solutions.
 
60 minutes in 1 hour
24 hours in 1 day
7 days in 1 week
52 weeks in 1 year
10 years is a decade
100 years is a century
1000 is a millennium
etc..
 
Back
Top