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

May only use once a hour..how to check?

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,152
Solutions
12
Reaction score
1,107
Location
Germany :O
Hello
I want to have a leaver which should only be able to be used once in a hour. The script is finished, I just want to know from you what to add to check this..
 
Hmmm per player or for everybody?

If its for everyone then you should make like this:

Lua:
if((os.time() - getGlobalStorageValue(2000)) > 1*60*1000) then
--WORKS
setGlobaStorageValue(2000, os.time())
else
--WAIT 1 HOUR
end
 
But isn't globalstorage for all players?
Every single player may use it once a hour. Not just once a hour all toghether.
 
But isn't globalstorage for all players?
Every single player may use it once a hour. Not just once a hour all toghether.

so you have script:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if((os.time() - getPlayerStorageValue(2000)) > 1*60*1000) then
    doPlayerSendCancel(cid,"Ohh you clicked on a leaver congrats.")
    setPlayerStorageValue(2000, os.time())
  else
    doPlayerSendCancel(cid,"Sorry you need to wait 1 hour.")
end

-edit-
edited
 
Last edited:
Back
Top