• 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 Experience Potion

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!
 
Lua:
local bronze = 1 * 60 * 60 * 1000 -- 1 hour
local prata = 2 * 60 * 60 * 1000 -- 2 hour
local ouro = 4 * 60 * 60 * 1000 -- 4 hour

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(item.itemid == 10614) then
        doRemoveItem(item.uid,1)
        doPlayerSetExperienceRate(cid,2)
        doSendMagicEffect(fromPosition,13)
        doPlayerSendTextMessage(cid,22,'You receive double the experience to kill a monster for '.. bronze / 3600000 ..' hour.')
        addEvent(fim, bronze, cid)
    elseif (item.itemid == 10615) then
        doRemoveItem(item.uid,1)
        doPlayerSetExperienceRate(cid,2)
        doSendMagicEffect(fromPosition,13)
        doPlayerSendTextMessage(cid,22,'You receive double the experience to kill a monster for '.. prata / 3600000 ..' hours.')
        addEvent(fim, prata, cid)
    elseif (item.itemid == 10616) then
        doRemoveItem(item.uid,1)
        doPlayerSetExperienceRate(cid,2)
        doSendMagicEffect(fromPosition,13)
        doPlayerSendTextMessage(cid,22,'You receive double the experience to kill a monster for '.. ouro / 3600000 ..' hours.')
        addEvent(fim, ouro, cid)
    end
    return TRUE
end


function fim(cid)
    doPlayerSetExperienceRate(cid, 1)
    doPlayerSendTextMessage(cid, 22, "Double experience ended.")
    return TRUE
end
 
Back
Top Bottom