• 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 How to put exhausted on this script? (manarune in action)

1268995

Member
Joined
Sep 9, 2010
Messages
422
Reaction score
13
How to put, like, delay of 5 seconds for use rune again? (8.60)

Code:
function onUse(cid, item, frompos, item2, topos)
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
formula = 4000
if item2.itemid == 1 and ml >= 1 then
doSendMagicEffect(playerpos,1)
doPlayerAddMana(player.uid,formula)

end
return 1
end
 
Code:
local sir_islam = {
exhausted = 5, -- Time you are exhausted. by second
storage = 90000 -- Storage used for "exhaust."
}

function onUse(cid, item, frompos, item2, topos)
if (getPlayerStorageValue(cid, sir_islam.storage) > os.time())then
return doPlayerSendCancel(cid,"You must wait another " .. getPlayerStorageValue(cid, sir_islam.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, sir_islam.storage) - os.time()) == 1 and "" or "s") .. ".")
end
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
formula = 4000
if item2.itemid == 1 and ml >= 1 then
doSendMagicEffect(playerpos,1)
doPlayerAddMana(player.uid,formula)
setPlayerStorageValue(cid, sir_islam.storage, os.time() + sir_islam.exhausted)
end
return 1
end
 
Back
Top