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

Use Item = Exp Bonus

God Mythera

Veteran OT User
Joined
Aug 11, 2012
Messages
2,048
Solutions
2
Reaction score
256
Location
United States
Hello and im wondering if i can have help with this script, when you use a item it says it gives you 1.6 exp but i am trying to figure out how to make it only like 50% experience.


This is the script i found on otland.
Code:
local config = {
rate = 1.6, -- 4x More Experience
time = 5, -- Hours of Exp Time
storage = 20011
}
local function endExpRate(cid)
if isPlayer(cid) == TRUE then
doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
setPlayerStorageValue(cid, config.storage, -1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerStorageValue(cid, config.storage) < 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hours.")
doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600)
addEvent(endExpRate, config.time * 3600 * 1000, cid)
doRemoveItem(item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.")
end
return TRUE
end

Can someone help me make it so when you use the item it only gives 50% exp? do i put it as 0.5? i dont know ;S
 
Code:
-- Rates
experienceStages = true
rateExperience = 1.0
If you read 2 posts more down the thread you would've seen my explanation.
1.0 = 100%
1.6 = 160%
0.5 = 50%

But if you have your 'rate' set at 5.0 for example, you'd need to change the script.
5.0 = 100%
8.0 = 160%
2.5 = 50%
 
Code:
-- Rates
experienceStages = true
rateExperience = 1.0
If you read 2 posts more down the thread you would've seen my explanation.
1.0 = 100%
1.6 = 160%
0.5 = 50%

But if you have your 'rate' set at 5.0 for example, you'd need to change the script.
5.0 = 100%
8.0 = 160%
2.5 = 50%
So i just change

Code:
rate = 1.6, -- 4x More Experience

to
Code:
rate = 0.5, -- 4x More Experience

?? ;o
 
I don't know how else to explain it.
The script changes the default rate of the player to the specified amount.
If your default rate is 1, then yes 0.5 is 50%.
If your default rate is not 1, then no, you need to go do some math.
 
I don't know how else to explain it.
The script changes the default rate of the player to the specified amount.
If your default rate is 1, then yes 0.5 is 50%.
If your default rate is not 1, then no, you need to go do some math.
normal exp at a character i made is 45,000 exp but when i used the item i got around 76,000
 
normal exp at a character i made is 45,000 exp but when i used the item i got around 76,000
I don't know how else to explain it.
The script changes the default rate of the player to the specified amount.
If your default rate is 1, then yes 0.5 is 50%.
If your default rate is not 1, then no, you need to go do some math.
 
Back
Top