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

Exp Boost item 1.3

in events/scripts/player.lua
Lua:
    if self:getStorageValue(60635) >= os.time() then
        exp = exp * 1.5 -- 1.5 = 50% EXP INCREASE
    end

actions/scripts
Code:
   function onUse(player, item, fromPos, target, toPos, isHotkey)
           local days = 2 -- 2 days of EXP boost
        player:setStorageValue(60635, os.time() + days * 86400)
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Now you have '. days .' days of exp boosting.')
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        item:remove(1)
        return true
    end
 
in events/scripts/player.lua
Lua:
    if self:getStorageValue(60635) >= os.time() then
        exp = exp * 1.5 -- 1.5 = 50% EXP INCREASE
    end

actions/scripts
Code:
   function onUse(player, item, fromPos, target, toPos, isHotkey)
           local days = 2 -- 2 days of EXP boost
        player:setStorageValue(60635, os.time() + days * 86400)
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Now you have '. days .' days of exp boosting.')
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        item:remove(1)
        return true
    end
how do i change that to 1.3
Post automatically merged:

in events/scripts/player.lua
Lua:
    if self:getStorageValue(60635) >= os.time() then
        exp = exp * 1.5 -- 1.5 = 50% EXP INCREASE
    end

actions/scripts
Code:
   function onUse(player, item, fromPos, target, toPos, isHotkey)
           local days = 2 -- 2 days of EXP boost
        player:setStorageValue(60635, os.time() + days * 86400)
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Now you have '. days .' days of exp boosting.')
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        item:remove(1)
        return true
    end

i tried this but doesnt work i change the storagevalue i think i did it right idk and you miss a dot . in days each side i add it too


local xpBoost1 = Action()

if self:getStorageValue(65004) >= os.time() then
exp = exp * 1.5 -- 1.5 = 50% EXP INCREASE
end
function xpBoost1.onUse(player, item, fromPos, target, toPos, isHotkey)
local days = 2 -- 2 days of EXP boost
player:setStorageValue(65004, os.time() + days * 86400)
player:sendTextMessage(MESSAGE_INFO_DESCR, "Now you have "..days.." days of exp boosting.")
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
item:remove(1)
return true
end
xpBoost1:id(2157)
xpBoost1:register()
 
Last edited:
C++:
local Daybonus = Action()

function Daybonus.onUse(player, item, fromPos, target, toPos, isHotkey)
           local days = 2 -- 2 days of EXP boost
        player:setStorageValue(60635, os.time() + days * 86400)
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Now you have ' days ' days of exp boosting.')
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        item:remove(1)
        return true
end

Daybonus:id(10306)
Daybonus:register()

Eh intentando hacerlo en revscript pero me sale este error

data\scripts\actions\ExpBoost.lua:6: ')' expected near 'days'
 
Back
Top