cavazospedro
Member
Does any body has a script for an item that gives you exp boost x2 or whatever for a certain time
thx in advance
thx in advance
if self:getStorageValue(60635) >= os.time() then
exp = exp * 1.5 -- 1.5 = 50% EXP INCREASE
end
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.3in 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
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()