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

Starting items

Hahstudios

New Member
Joined
Mar 11, 2010
Messages
49
Solutions
3
Reaction score
1
im a nub i know this but is there anyone that has an easy creature script for starting items i have looked through the forums and they ones i have found keep giving me errors.
im using tfs v1.2 please and thank you!!
 
Solution
actually forgot about posting this been working with znote in pms trying to get it fixed turns out it was a simple creaturescript.xml error i had the entire time XD i was trying to register it with a script within instead of just normally
It's working on my TFS 1.1. Let me know if it works for you.

Lua:
local config = {
        [1] = {
                --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, amulet of loss
                items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2173, 1}},
                --container rope, shovel, mana potion, 10 platinum coin
                container = {{2120, 1}, {2554, 1}, {7620, 10}, {2152, 10}}
        },
        [2] = {
                --equipment spellbook, snakebite rod, magician's robe, mage hat, studded legs, leather boots, amulet of loss
                items = {{2175, 1}, {2182, 1}, {8819, 1}, {8820, 1}, {2468, 1}, {2643, 1}, {2173, 1}},
                --container rope, shovel, mana potion, 10 platinum coin
                container = {{2120, 1}, {2554, 1}, {7620, 10}, {2152, 10}}
        },
        [3] = {
                --equipment dwrven shield, 5 spear, ranger's cloak, ranger legs, legion helmet, amulet of loss
                items = {{2525, 1}, {2389, 5}, {2660, 1}, {8923, 1}, {2643, 1}, {2480, 1}, {2173, 1}},
                --container rope, shovel, health potion, bow, 50 arrow, 10 platinum coin
                container = {{2120, 1}, {2554, 1}, {7618, 10}, {2456, 1}, {2544, 50}, {2152, 10}}
        },
        [4] = {
                --equipment dwarven shield, steel axe, brass armor, brass helmet, brass legs, amulet of loss
                items = {{2525, 1}, {8601, 1}, {2465, 1}, {2460, 1}, {2478, 1}, {2643, 1}, {2173, 1}},
                --container jagged sword, daramian mace, rope, shovel, health potion, 10 platinum coin
                container = {{8602, 1}, {2439, 1}, {2120, 1}, {2554, 1}, {7618, 10}, {2152, 10}}
        }
}

function onLogin(player)
    if player:getLastLoginSaved() ~= 0 then
        return true
    end
   
    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
    return true
end
 
actually forgot about posting this been working with znote in pms trying to get it fixed turns out it was a simple creaturescript.xml error i had the entire time XD i was trying to register it with a script within instead of just normally
 
Solution
Back
Top