• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Extra Experience Potion

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
A simply script to increase exp rate of donators.


Why is this script better than Experience Ring?
1. Many people posted in Request and Support a way to stop Server Crashes because of Experience Rings.
2. Some 'smart' guys just 'use' the experience ring when a monster is dying so this ring will last longer.


LUA:
function onUse(cid, item, frompos, item2, topos) 

local end = 60*60*1000
local text = "You have extra experience for 1 hour"
local textfinal = "Your bonus time has ended."
local exp = 2.0
loacl expfinal = 1
    if isPlayer(cid) then 
        doRemoveItem(item.uid,1) 
        doPlayerSetExperienceRate(cid,exp) 
        doSendMagicEffect(frompos,13) 
        doPlayerSendTextMessage(cid,22,text) 
        addEvent(potion,end,cid) 
    end 
end 
  
function potion(pos, cid) 
    doPlayerSetExperienceRate(pos,expfinal) 
    doPlayerSendTextMessage(pos,22,textfinal) 
end

There are better ways to write this script, if you know how just post here
 
give player a storage in a script, then make doPlayerSetExperienceRate(cid, rate) at onLogin script
 
Mm only need potion give storage.. for example..

function onUse(cid, item, frompos, item2, topos)
doSendMagicEffect(frompos,13)
setPlayerStorageValue(cid, 12345, 0)
end

function onLogin(cid)
if getPlayerStorageValue(cid, 12345) == 0 then
setPlayerExtraExpRate(cid, getPlayerExtraExpRate(cid)+15)
setPlayerStorageValue(cid, 12345, 1)

elseif getPlayerStorageValue(cid, 12345) == 1 then
setPlayerExtraExpRate(cid, getPlayerExtraExpRate(cid)-15)
setPlayerStorageValue(cid, 12345, 0)
end

return TRUE
end

maybe work >.<
 
loacl expfinal = 1

fix bro

----

+ other tip for u

LUA:
local storage = 100
function checkTime(cid)
	return getPlayerStorageValue(cid, storage) > os.time() and true or false
end
function addTime(cid, time) -- time in seconds
	return setPlayerStorageValue(cid, storage, os.time() +time)
end
 
Last edited:
Back
Top