• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua TFS 1.2 Replace EQ at 8 lvl

Roni123

Hardstyle Never Die < 3 !!!
Joined
Aug 31, 2010
Messages
152
Solutions
1
Reaction score
19
Hello,

Dears,

I'm looking for a script on TFS 1.2 while ppl make 8 lvl and choose they vocation then old EQ going to replacement on new one depending on vocation. I'm trying to found something in otland but without effect :/

Thanks in advance !
 
Hello,

Dears,

I'm looking for a script on TFS 1.2 while ppl make 8 lvl and choose they vocation then old EQ going to replacement on new one depending on vocation. I'm trying to found something in otland but without effect :/

Thanks in advance !
can be written with function onThink in creaturescripts with if command on this statement (player:getVocation() == X and player:getLevel() == 8 and player:getStorageValue(XXX, Y) -- Added storage to prevent repetition and lags. then
for i = 1, 10 do local eq_slot = player:getSlotItem(i) if eq_slot then item:remove() -- not sure if this command will remove the item end end
then add the player new items using firstitems codes.
 
can be written with function onThink in creaturescripts with if command on this statement (player:getVocation() == X and player:getLevel() == 8 and player:getStorageValue(XXX, Y) -- Added storage to prevent repetition and lags. then
for i = 1, 10 do local eq_slot = player:getSlotItem(i) if eq_slot then item:remove() -- not sure if this command will remove the item end end
then add the player new items using firstitems codes.
Bro current I'm trying to do it without getstorage to check if this work and below are my written script but can't work, I choose sorcerer to easy way to test, any idea ?
LUA:
function onThink(cid, interval)
    if getPlayerVocation(cid) == 1 and player:getLevel() == 8 then
for i = 1, 10 do
local eq_slot = player:getSlotItem(i)
if eq_slot then
item:remove() -- not sure if this command will remove the item
end
end

local config = {
    [1] = {
        --equipment spellbook, wand of vortex, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2175, 1}, {2190, 1}, {2483, 1}, {2481, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom
        container = {{2120, 1}, {2554, 1}, {2795, 10}}
    },
    [0] = {
        --equipment spellbook, wand of vortex, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2512, 1}, {2398, 1}, {2467, 1}, {2461, 1}, {2649, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom
        container = {{2120, 1}, {2554, 1}, {2789, 10}}
    },
    [2] = {
        --equipment spellbook, snakebite rod, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2175, 1}, {2190, 1}, {2483, 1}, {2481, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom
        container = {{2120, 1}, {2554, 1}, {2795, 10}}
    },
    [3] = {
        --equipment copper shield, 5 spear, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2530, 1}, {2389, 5}, {2483, 1}, {2481, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom
        container = {{2120, 1}, {2554, 1}, {2795, 10}}
    },
    [4] = {
        --equipment copper shield, orcish axe, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2530, 1}, {2428, 1}, {2483, 1}, {2481, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom, scimitar, battle hammer
        container = {{2120, 1}, {2554, 1}, {2795, 10}, {2419, 1}, {2417, 1}}
    }
}
 
Bro current I'm trying to do it without getstorage to check if this work and below are my written script but can't work, I choose sorcerer to easy way to test, any idea ?
LUA:
function onThink(cid, interval)
    if getPlayerVocation(cid) == 1 and player:getLevel() == 8 then
for i = 1, 10 do
local eq_slot = player:getSlotItem(i)
if eq_slot then
item:remove() -- not sure if this command will remove the item
end
end

local config = {
    [1] = {
        --equipment spellbook, wand of vortex, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2175, 1}, {2190, 1}, {2483, 1}, {2481, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom
        container = {{2120, 1}, {2554, 1}, {2795, 10}}
    },
    [0] = {
        --equipment spellbook, wand of vortex, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2512, 1}, {2398, 1}, {2467, 1}, {2461, 1}, {2649, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom
        container = {{2120, 1}, {2554, 1}, {2789, 10}}
    },
    [2] = {
        --equipment spellbook, snakebite rod, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2175, 1}, {2190, 1}, {2483, 1}, {2481, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom
        container = {{2120, 1}, {2554, 1}, {2795, 10}}
    },
    [3] = {
        --equipment copper shield, 5 spear, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2530, 1}, {2389, 5}, {2483, 1}, {2481, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom
        container = {{2120, 1}, {2554, 1}, {2795, 10}}
    },
    [4] = {
        --equipment copper shield, orcish axe, scale armor, soldier helmet, brass legs, leather boots, scarf
        items = {{2530, 1}, {2428, 1}, {2483, 1}, {2481, 1}, {2478, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, fire mushroom, scimitar, battle hammer
        container = {{2120, 1}, {2554, 1}, {2795, 10}, {2419, 1}, {2417, 1}}
    }
}
you can't do that this will keep cleaning any sorc player with level 8 till he is level 9 you have to use storage or another function as a flag technique that he have received his items
 
you can't do that this will keep cleaning any sorc player with level 8 till he is level 9 you have to use storage or another function as a flag technique that he have received his items
Yes bro I know, I will add this function but if my script going to work xd
 
LUA:
local config = {
        [1] = {
                --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
                items = {{2190, 1}, {2195, 1}, {2488, 1}, {2487, 1}, {2491, 1}, {2519, 1}},
                --container rope, shovel, mana potion
                container = {{2120, 1}, {2554, 1}, {2160, 20}, {2159, 10}, {2276, 1}, {2273, 1}},
        },
        [2] = {
                --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
                items = {{2182, 1}, {2195, 1}, {2488, 1}, {2487, 1}, {2491, 1}, {2519, 1}, {2276, 1}, {2273, 1}},
                --container rope, shovel, mana potion
                container = {{2120, 1}, {2160, 20}, {2554, 1}, {2276, 1}, {2273, 1}, {2159, 10}},
        },
        [3] = {
                --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
                items = {{2389, 1}, {2195, 1}, {2488, 1}, {2487, 1}, {2491, 1}, {2519, 1}},
                --container rope, shovel, health potion, bow, 50 arrow
                container = {{2120, 1}, {2554, 1}, {2160, 20}, {2276, 1}, {2273, 1}, {2159, 10}},
        },
        [4] = {
                --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
                items = {{8601, 1}, {2195, 1}, {2488, 1}, {2487, 1}, {2491, 1}, {2519, 1}},
                --container jagged sword, daramian mace, rope, shovel, health potion
                container = {{8602, 1}, {2439, 1}, {2160, 20}, {2276, 1}, {2273, 1}, {2159, 10}}
        }
}

function onThink(player, interval)
    local storage = 93014 -- will use this storage to prevent issues as well
    if player:getLevel() == 8 and player:getStorageValue(storage) < 1 then
    for i = 1, 10 do
        local eq_slot = player:getSlotItem(i)
        if eq_slot then
            eq_slot:remove() -- not sure if this command will remove the item
        end
    end
    player:setStorageValue(storage, 2)
    local targetVocation = config[player:getVocation():getId()]
    if not targetVocation then
        return true
    end

    for i = 1, #targetVocation.items do
        player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
    end

    local backpack = player:addItem(1988)
    if not backpack then
        return true
    end

    for i = 1, #targetVocation.container do
        backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
    end
  end
    return true
end
Full with storage and for the 4 vocations not promoted for sure
 
Last edited by a moderator:
LUA:
local config = {
        [1] = {
                --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
                items = {{2190, 1}, {2195, 1}, {2488, 1}, {2487, 1}, {2491, 1}, {2519, 1}},
                --container rope, shovel, mana potion
                container = {{2120, 1}, {2554, 1}, {2160, 20}, {2159, 10}, {2276, 1}, {2273, 1}},
        },
        [2] = {
                --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots scarf
                items = {{2182, 1}, {2195, 1}, {2488, 1}, {2487, 1}, {2491, 1}, {2519, 1}, {2276, 1}, {2273, 1}},
                --container rope, shovel, mana potion
                container = {{2120, 1}, {2160, 20}, {2554, 1}, {2276, 1}, {2273, 1}, {2159, 10}},
        },
        [3] = {
                --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs scarf, legion helmet
                items = {{2389, 1}, {2195, 1}, {2488, 1}, {2487, 1}, {2491, 1}, {2519, 1}},
                --container rope, shovel, health potion, bow, 50 arrow
                container = {{2120, 1}, {2554, 1}, {2160, 20}, {2276, 1}, {2273, 1}, {2159, 10}},
        },
        [4] = {
                --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs scarf
                items = {{8601, 1}, {2195, 1}, {2488, 1}, {2487, 1}, {2491, 1}, {2519, 1}},
                --container jagged sword, daramian mace, rope, shovel, health potion
                container = {{8602, 1}, {2439, 1}, {2160, 20}, {2276, 1}, {2273, 1}, {2159, 10}}
        }
}

function onThink(player, interval)
    local storage = 93014 -- will use this storage to prevent issues as well
    if player:getLevel() == 8 and player:getStorageValue(storage) < 1 then
    for i = 1, 10 do
        local eq_slot = player:getSlotItem(i)
        if eq_slot then
            eq_slot:remove() -- not sure if this command will remove the item
        end
    end
    player:setStorageValue(storage, 2)
    local targetVocation = config[player:getVocation():getId()]
    if not targetVocation then
        return true
    end

    for i = 1, #targetVocation.items do
        player:addItem(targetVocation.items[i][1], targetVocation.items[i][2])
    end

    local backpack = player:addItem(1988)
    if not backpack then
        return true
    end

    for i = 1, #targetVocation.container do
        backpack:addItem(targetVocation.container[i][1], targetVocation.container[i][2])
    end
  end
    return true
end
Full with storage and for the 4 vocations not promoted for sure
Still nothing bro :/ Don't work and 0 errors at console but Thank you in advance for support !
 
Back
Top