• 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 Double Exp Item TFS 0.4

FearWar

Active Member
Joined
Sep 17, 2017
Messages
221
Reaction score
26
Location
Brasil
Hello guys from Otland,

Find this script below, however, when the player dies / disables the experience is not doubled, and try to use again or scroll the page that is already being used.

OBS: Is there a way to double double loot too?

Lua:
local config = {
    rate = 2,
    time = 1, -- Hours of Exp Time
    storage = 20014
}
local function endExpRate(cid)
    if isPlayer(cid) == TRUE then
        doPlayerSetRate(cid, SKILL__LEVEL, 3) -- 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) < os.time() then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have experience rate x2 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
 
Solution
Please use search, It is already posted many times and solved
I dont use the function doPlayerSetRate() for years, but if im not wrong,
you have to call the function again when player dies / log in.
and remember you have to call addEvent to remove bonuses
 
I dont use the function doPlayerSetRate() for years, but if im not wrong,
you have to call the function again when player dies / log in.
and remember you have to call addEvent to remove bonuses
can you help me? I don't have much experience on the moon, or if you already have something ready and can help me
 
Please use search, It is already posted many times and solved
 
Solution
Please use search, It is already posted many times and solved
Thank you very much friend, I was looking at the post only where it was resolved, but another part was missing in creaturescript, and now I looked better and got to see it!
 
Back
Top