• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Experencie ring onUse

Erikas Kontenis

Board Moderator
Staff member
Board Moderator
Joined
Jul 3, 2009
Messages
1,868
Reaction score
575
Location
Lithuania
This was created specialy for this boy who dont know anything and nobody helps him. Saw it on page so thinked to make it for him. http://otland.net/f81/extra-experience-potion-148898/

It will works even if you logged out and then after year comed in.

actions.xml
Lua:
<action itemid="7762" event="script" value="istrinti.lua"/>

istrinti.lua
Lua:
local cfg = {
exhausted = 100, -- Time you are exhausted in seconds.
storage = 5858, -- Storage used for "exhaust."
exp = 2.0 -- this means 2x more experence then default
}

function onUse(cid, item)
if(getPlayerStorageValue(cid, cfg.storage) > os.time() and getPlayerStorageValue(cid, cfg.storage) < 100+os.time()) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, cfg.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, cfg.storage) - os.time()) == 1 and "" or "s") .. " to use another ring.")
else
doRemoveItem(item.uid,1) 
setPlayerStorageValue(cid, cfg.storage, os.time() + cfg.exhausted)
doPlayerSetExperienceRate(cid, cfg.exp)
doPlayerSendTextMessage(cid,22,"You have extra experience for 100 seconds") 
end
return true
end

creaturescripts.xml
Lua:
<event type="think" name="istrinti2" event="script" value="istrinti2.lua"/>

login.lua
Lua:
registerCreatureEvent(cid, "istrinti2") -- add it near the other registers

istrinti2.lua
Lua:
local cfg = {
storage = 5858, -- Storage used for "exhaust."
exp = 2.0 -- this means 2x more experence then default
}

function onThink(cid)
if(getPlayerStorageValue(cid, cfg.storage) > os.time() and getPlayerStorageValue(cid, cfg.storage) < 100+os.time()) then
doPlayerSetExperienceRate(cid, cfg.exp)
else
doPlayerSetExperienceRate(cid, 1.0)
end
return true
end

have fun.
 
Last edited:
GOOD, now my server got bugged and I cannot fix it, NICE ONE Erikas. I'm really thankful.
 
GOOD, now my server got bugged and I cannot fix it, NICE ONE Erikas. I'm really thankful.

Should always try things first on like a Test server before going live with your changes.
Comon sense goes a long way in this world mate
 
This wasn't wether a test or a real server.. Well I'm building it to be a real server, and I was like adding stuffs, and suddenly I found this script. I don't even know why he got a script that isn't in work.
 
Well you could post the errors you get after the installment of the script, and we could try and help you out mate.
 
Sorry for double post but can you tell me another 2x experience script?
 
yeah amulet's just copy the ring script and change the ID of the ring, to an amulet and if you dont want the amulet to run out remove the time. thats probs easiest way for learners..
 
Back
Top