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

Solved exp rate

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,683
Solutions
36
Reaction score
388
how i can make double exp for x mount of creature? like when use exp scroll u ave duble exp for kill 100 creature and when kill 100 creature double exp end
 
Code:
local storage = 38747
function onUse(cid, item, fromPosition, itemEx, toPosition)
     if getPlayerStorageValue(cid, storage) == -1 then
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now double for 100 monsters.")
         doPlayerSetRate(cid, SKILL__LEVEL, 2)
         setPlayerStorageValue(cid, storage, 0)
         doRemoveItem(item.uid, 1)
     else
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have "..(100-getPlayerStorageValue(cid, storage)).." monsters left to kill before the double experience is over.")
     end
     return true
end
Code:
local storage = 38747
function onKill(cid, target)
     if getPlayerStorageValue(cid, storage) >= 0 and getPlayerStorageValue(cid, storage) <= 100 then
         setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
     end
     if getPlayerStorageValue(cid, storage) == 100 then
         setPlayerStorageValue(cid, storage, -1)
         doPlayerSetRate(cid, SKILL__LEVEL, 1)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed 100 monsters, the double experience has ended.")
     end
     return true
end
 
Last edited:
i killed like 200 creautur and see msg :S
Code:
00:11 You still have 100 monsters left to kill before the double experience is over.
 
when player die or relog will loss double exp right ?


and its my talkaction its work fine
Code:
local storage = 38747
function onSay(cid, words, param)
     if getPlayerStorageValue(cid, storage) == -1 then        
         doPlayerSetRate(cid, SKILL__LEVEL, 2)
         setPlayerStorageValue(cid, storage, 0)
     else
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have "..(100-getPlayerStorageValue(cid, storage)).." monsters left to kill before the double experience is over.")
     end
     return true
end
 
You can add this in config.lua.
Code:
if getPlayerStorageValue(cid, storage) >= 0 then 
    doPlayerSetRate(cid, SKILL__LEVEL, 2)
end
Btw forgot to add 1 part in the onKill script, so replace/change it with the edited version from my post.
 
so it will be like this ?
Code:
local storage = 38747
function onKill(cid, target)
     if getPlayerStorageValue(cid, storage) >= 0 then
    doPlayerSetRate(cid, SKILL__LEVEL, 2)
end
getPlayerStorageValue(cid, storage) <= 100 then
         setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
     end
     if getPlayerStorageValue(cid, storage) == 100 then
         setPlayerStorageValue(cid, storage, -1)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed 100 monsters, the double experience has ended.")
     end
     return true
end

and talkaction buged when i say !exprat when player kill 100 creature it add storage again for playe
 
Last edited:
Code:
local storage = 38747
function onKill(cid, target)
     if getPlayerStorageValue(cid, storage) >= 0 and getPlayerStorageValue(cid, storage) <= 100 then
         setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
     end
     if getPlayerStorageValue(cid, storage) == 100 then
         setPlayerStorageValue(cid, storage, -1)
         doPlayerSetRate(cid, SKILL__LEVEL, 1)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed 100 monsters, the double experience has ended.")
     end
     return true
end
Code:
<event type="Kill" name="onkill" event="script" value="exp100.lua"/>
Code:
registerCreatureEvent(cid, "onkill")
that all in my creature script and i need talkaction script my script buged :S
 
my problem in talkaction script when kill 100 creature and i say !exprat player get new double exp for more 100 creature
 
u can edite talkaction script for when player say !exprate and he don't use exp potion its say "there no exp potion active"?
Code:
local storage = 38747
function onSay(cid, words, param)
     if getPlayerStorageValue(cid, storage) == -1 then      
         doPlayerSetRate(cid, SKILL__LEVEL, 2)
      else
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have "..(100-getPlayerStorageValue(cid, storage)).." monsters left to kill before the double experience is over.")
     end
     return true
end
 
Back
Top