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

Time Limit on Lever

Lucid

Pure~
Joined
Jun 27, 2009
Messages
99
Reaction score
0
Location
LA
Is it possible to make it so that A lever is only used every 15 minutes? or a given amount of time? if so can someone make one?

Would Really Appreciate it Thanks
 
For all players or only the one who used it ?
For one:
Lua:
function onUse(cid, item, frompos, item2, topos)
local minutes = 15
if getPlayerStorageValue(cid,53440) <= os.time() then
--script--
setPlayerStorageValue(cid, 53440, os.time() + (minutes*60*1000))
else
doPlayerSendCancel(cid,"You have to wait.")
end
end

For all
Lua:
function onUse(cid, item, frompos, item2, topos)
local minutes = 15
if getGlobalStorageValue(53440) <= os.time() then
--script--
setGlobalStorageValue(53440, os.time() + (minutes*60*1000))
else
doPlayerSendCancel(cid,"You have to wait.")
end
end
 
without storages
Lua:
local timee = 0;
function onUse(cid, item, frompos, item2, topos)
local minutes = 15
if timee <= os.time() then
--script--
timee= os.time() + (minutes*60*1000);
else
doPlayerSendCancel(cid,"You have to wait.")
end
end
 
Back
Top Bottom