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

ninolouco

Member
Joined
Mar 11, 2019
Messages
28
Reaction score
8
Hi, otland, im using the forgotten server 1.2

How add this code

Lua:
player:getVocation():getId() ~= 0 and player:getVocation():getId() < 5 and player:getStorageValue(30018) == 1 then
            player:setVocation(player:getVocation():getId() + 4)

inside this code? is it possible? someone can help me ?

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    player:addPremiumDays(30)
    player:sendTextMessage(MESSAGE_INFO_DESCR, "premium account.")
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    item:remove(1)
    return true
end

thanks
 
Solution
Hi, otland, im using the forgotten server 1.2

How add this code

Lua:
player:getVocation():getId() ~= 0 and player:getVocation():getId() < 5 and player:getStorageValue(30018) == 1 then
            player:setVocation(player:getVocation():getId() + 4)

inside this code? is it possible? someone can help me ?

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    player:addPremiumDays(30)
    player:sendTextMessage(MESSAGE_INFO_DESCR, "premium account.")
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    item:remove(1)
    return true
end

thanks
If you want the vocation to determine if ALL these functions should work then do this:
Lua:
local storage = 30018

function onUse(player, item...
Hi, otland, im using the forgotten server 1.2

How add this code

Lua:
player:getVocation():getId() ~= 0 and player:getVocation():getId() < 5 and player:getStorageValue(30018) == 1 then
            player:setVocation(player:getVocation():getId() + 4)

inside this code? is it possible? someone can help me ?

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    player:addPremiumDays(30)
    player:sendTextMessage(MESSAGE_INFO_DESCR, "premium account.")
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    item:remove(1)
    return true
end

thanks
If you want the vocation to determine if ALL these functions should work then do this:
Lua:
local storage = 30018

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local voc_id = player:getVocation():getId()
    if voc_id ~= 0 and voc_id < 5 and player:getStorageValue(storage) == 1 then
        player:setVocation(voc_id + 4)
        player:addPremiumDays(30)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "premium account.")
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
        item:remove(1)
    end
    return true
end

If you want vocation to only determine the vocation change and let the rest continue no matter what then do this:
Lua:
local storage = 30018

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local voc_id = player:getVocation():getId()
    if voc_id ~= 0 and voc_id < 5 and player:getStorageValue(storage) == 1 then
        player:setVocation(voc_id + 4)
    end
    player:addPremiumDays(30)
    player:sendTextMessage(MESSAGE_INFO_DESCR, "premium account.")
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    item:remove(1)
    return true
end
 
Solution
Back
Top