dragaoart
Since 2009...
- Joined
- May 10, 2009
- Messages
- 97
- Reaction score
- 9
Lua:
local bronze = 1 * 60 * 60 * 1000 -- 1 hour
local prata = 2 * 60 * 60 * 1000 -- 2 hour
local ouro = 4 * 60 * 60 * 1000 -- 3 hour
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 10614 then
doRemoveItem(item.uid,1)
doPlayerSetExperienceRate(cid,2)
doSendMagicEffect(frompos,13)
doPlayerSendTextMessage(cid,22,'You receive double the experience to kill a monster for '.. bronze / 3600000 ..' hour.')
addEvent(fim, bronze, cid)
else if item.itemid == 10615 then
doRemoveItem(item.uid,1)
doPlayerSetExperienceRate(cid,2)
doSendMagicEffect(frompos,13)
doPlayerSendTextMessage(cid,22,'You receive double the experience to kill a monster for '.. prata / 3600000 ..' hours.')
addEvent(fim, prata, cid)
else if item.itemid == 10616 then
doRemoveItem(item.uid,1)
doPlayerSetExperienceRate(cid,2)
doSendMagicEffect(frompos,13)
doPlayerSendTextMessage(cid,22,'You receive double the experience to kill a monster for '.. ouro / 3600000 ..' hours.')
addEvent(fim, ouro, cid)
end
end
end
end
function fim(cid)
doPlayerSetExperienceRate(cid,1)
doPlayerSendTextMessage(cid,22,'Double experience ended.')
end
The double experience ends when the character dies.
I would like to create a parameter where it storage on the player, and 'ticks' only when he/she is alive (online).
Maybe related to check on login... if player is online, the script will running from where it stops.
Any Idea?
Thanks!