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

Statue giving 5% stats with cooldown.

mikkas70

Owner and Developer of omegaservers.org
Joined
Jan 6, 2009
Messages
42
Reaction score
8
TFS 0.4
Version : 8.60

I would like to have a script where people would click a statue, and they would get 5% bonus mana and HP for 30 minutes.
Clicking the statue would have a 60 minutes cooldown.
 
Code:
local storage = 39853

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 30 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 105)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, 105)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)

function onUse(cid, item, fromPosition, itemEx, toPosition)

     if exhaustion.check(cid, storage) then
         return doPlayerSendCancel(cid, "You can only use this statue every hour.")
     end
     doAddCondition(cid, condition)
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have 5% extra mana and hp for 30 minutes.")
     exhaustion.set(cid, storage, 60 * 60)
     return true
end
 
Code:
local storage = 39853

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 30 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 105)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPERCENT, 105)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)

function onUse(cid, item, fromPosition, itemEx, toPosition)

     if exhaustion.check(cid, storage) then
         return doPlayerSendCancel(cid, "You can only use this statue every hour.")
     end
     doAddCondition(cid, condition)
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have 5% extra mana and hp for 30 minutes.")
     exhaustion.set(cid, storage, 60 * 60)
     return true
end
Script works fine, thank you.
 
Back
Top