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

[Mod & Lua] Advanced First Items (useRunes, useSlot, slotType, useMessage, inContainer)

Do you find this MOD useful?

  • Yes, of course! Thank you!

  • No, not exactly. But thank you.

  • Somewhat, yes. Thank you.


Results are only viewable after voting.
I got this weird issue on TFS 0.3.7, i mean i have used this mod before and everything worked fine, but now when i create character it starts completley naked - no items equiped at all, not even a container.
I get no errors in console, (loading mod firstitemx.xm - done), this is really weird and i got no idea what could be causing this problem, im using 9.83 client protocol, could it be this "new" slot system causing this?
 
I got this weird issue on TFS 0.3.7, i mean i have used this mod before and everything worked fine, but now when i create character it starts completley naked - no items equiped at all, not even a container.
I get no errors in console, (loading mod firstitemx.xm - done), this is really weird and i got no idea what could be causing this problem, im using 9.83 client protocol, could it be this "new" slot system causing this?

Are you using r5946 or another version?

I haven't tested this for a while. I'll do some testing once school is over and update it, if necessary. However, it should work fine.
 
Using rev 5940, I would really appricate if you could test it or find whats wrong, i really love the mod! It's really strange it doesn't work for me or it doesn't give any errors :('

I tested it with latest rev, still doesn't work, there must some issue with equipment slots.
 
Last edited:
Using rev 5940, I would really appricate if you could test it or find whats wrong, i really love the mod! It's really strange it doesn't work for me or it doesn't give any errors :('

I tested it with latest rev, still doesn't work, there must some issue with equipment slots.

I'm having the same problems as you :/
 
bump
still looking for a fix

I'm using this on 0.3.7 and it works. Not sure why it isn't working for you. I am running 0.3.7 (9.46) downgraded to 8.60.

Maybe it's an issue with the latest updates? The code is fine.

I've added another version to the main post. Try adding it to creaturescripts and using it that way, as opposed to using it as a Mod.

Nobody can deny that J.Dre is one of the best scripters, maybe the best

Too much credit!
 
Important Information!

Using rev 5940, I would really appricate if you could test it or find whats wrong, i really love the mod! It's really strange it doesn't work for me or it doesn't give any errors :('

I tested it with latest rev, still doesn't work, there must some issue with equipment slots.

So, I've done some extensive testing and have found out what the problem is. There is a function that isn't functioning how it should. :rolleyes: getPlayerLastLoginSaved(cid) does not seem to work anymore on the latest version of TFS 0.3. If you use a storage value instead of "getPlayerLastLoginSaved(cid)" the script will work.

I've made a report in the projects area and hope to see this addressed soon. ;)
 
Last edited:
Thank you for looking into it!
Unfortunately it still doesn't seem to work for me even as creaturescript. But i appriciate your work!

You must spread some Reputation around before giving it to J.Dre again.
 
Update v2.2: Repaired issues.

Thank you for looking into it!
Unfortunately it still doesn't seem to work for me even as creaturescript. But i appriciate your work!

You must spread some Reputation around before giving it to J.Dre again.

Updated the script to v2.2. It now works with the latest TFS 0.3. :D
 
I found it pretty messy if you log into acc manager with this mod, therefore:
if(not getCreatureName(cid) == "Account Manager") then
--script
end

@down
eq on classic slots

and... edit: commonitems are given to all players so it doesn't actually fix the problem and I prefer him without eq ^^
 
Last edited:
Ah finally working! I really appriciate your work! I am so grateful :D
Lov you man :D :D

Thank you!
 
Im trying to add a spear into the backpack but everytime i do i get an error, i know its prolly something im doing but could you help me?
im using 0.3.6, and it is also filling my backpack with arrows, i dont know why

- - - Updated - - -

i fixed this problem, thanks though
 
I know this is pretty old but anyone have any idea how to edit start items for custom vocations?
Code:
local config = {
    [1] = {
        --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
        items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2649, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, mana potion
        container = {{2120, 1}, {2554, 1}, {7620, 5}, {2789, 20}}
    },
    [2] = {
        --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots scarf
        items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2649, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, mana potion
        container = {{2120, 1}, {2554, 1}, {7620, 5}, {2789, 20}}
    },
}

function onLogin(player)
    local targetVocation = config[player:getVocation():getId()]
    if not targetVocation then
        return true
    end

    if player:getLastLoginSaved() ~= 0 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

add this to data/creaturescripts/scripts/firstitems or /other/firstitems
 
Code:
local config = {
    [1] = {
        --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots, scarf
        items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2649, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, mana potion
        container = {{2120, 1}, {2554, 1}, {7620, 5}, {2789, 20}}
    },
    [2] = {
        --equipment spellbook, wand of vortex, magician's robe, mage hat, studded legs, leather boots scarf
        items = {{2175, 1}, {2190, 1}, {8819, 1}, {8820, 1}, {2649, 1}, {2643, 1}, {2661, 1}},
        --container rope, shovel, mana potion
        container = {{2120, 1}, {2554, 1}, {7620, 5}, {2789, 20}}
    },
}

function onLogin(player)
    local targetVocation = config[player:getVocation():getId()]
    if not targetVocation then
        return true
    end

    if player:getLastLoginSaved() ~= 0 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

add this to data/creaturescripts/scripts/firstitems or /other/firstitems


Getting errors. Running 0.4 tfs

5ovFpUZ.png
 
Getting errors. Running 0.4 tfs

5ovFpUZ.png
I'm not familiar with 0.4 so I can't really help you with that, but I could suggest opening the firstitems.lua you already have and copy the format of the function (most likely to replace "function onLogin(player)" to something else) to the newer script
 
Back
Top