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

TFS 1.X+ npc wont sell me 3 items, 1 works

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
921
Location
Chile
Hello guys, i have this really weird problem that i can't solve, this npc used to work fine a while ago idk what happens
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Derrik" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="1038"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Hola |PLAYERNAME|, interesado?."/>
        <parameter key="shop_buyable" value="overmind mage ring,30439,3000000;overmind heavy ring,30438,3000000;
        overflow energy ring,30442,1500000;boss egg,30170,30000000"/>
    </parameters>
</npc>

this sells 3 rings and 1 boss egg, but it only sells the boss egg, i cant buy any other item, and the items are fine, they work fine and they can be picked up and used so i have really no idea what the hell, also no error in console :/

plz guys does anyone know what is happening?
tfs 1.3
 
Code:
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Hola |PLAYERNAME|, interesado?." />
        <parameter key="shop_buyable" value="overmind mage ring, 30439, 3000000" />
        <parameter key="shop_buyable" value="overmind heavy ring, 30438, 3000000" />
        <parameter key="shop_buyable" value="overflow energy ring, 30442, 1500000" />
        <parameter key="shop_buyable" value="boss egg, 30170, 30000000" />
    </parameters>
Check this :p
 
Code:
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Hola |PLAYERNAME|, interesado?." />
        <parameter key="shop_buyable" value="overmind mage ring, 30439, 3000000" />
        <parameter key="shop_buyable" value="overmind heavy ring, 30438, 3000000" />
        <parameter key="shop_buyable" value="overflow energy ring, 30442, 1500000" />
        <parameter key="shop_buyable" value="boss egg, 30170, 30000000" />
    </parameters>
Check this :p
now it doesnt even show the ring in the trade window D:
 
Try to copy paste exactly like this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Derrik" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="1038"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Hola |PLAYERNAME|, interesado?."/>
        <parameter key="shop_buyable" value="overmind mage ring,30439,3000000;overmind heavy ring,30438,3000000;overflow energy ring,30442,1500000;boss egg,30170,30000000"/>
    </parameters>
</npc>
 
Try to copy paste exactly like this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Derrik" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="1038"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Hola |PLAYERNAME|, interesado?."/>
        <parameter key="shop_buyable" value="overmind mage ring,30439,3000000;overmind heavy ring,30438,3000000;overflow energy ring,30442,1500000;boss egg,30170,30000000"/>
    </parameters>
</npc>
same :/ i still cant buy the rings :(
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Derrik" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="1038"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Hola |PLAYERNAME|, interesado?."/>
        <parameter key="shop_buyable" value="
overmind mage ring, 30439, 3000000;
overmind heavy ring, 30438, 3000000;
overflow energy ring, 30442, 1500000;
boss egg, 30170, 30000000 "/>
    </parameters>
</npc>

But i think this is for 0.3.6 script, not for 1.x ?
There you go solve :p
Solved - TFS 1.2 Npc's?
 
Last edited:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Derrik" script="default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="1038"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Hola |PLAYERNAME|, interesado?."/>
        <parameter key="shop_buyable" value="
overmind mage ring, 30439, 3000000;
overmind heavy ring, 30438, 3000000;
overflow energy ring, 30442, 1500000;
boss egg, 30170, 30000000 "/>
    </parameters>
</npc>

But i think this is for 0.3.6 script, not for 1.x ?
There you go solve :p
Solved - TFS 1.2 Npc's?
i tried that, but i still have the same problem :/ npc only sells boss egg, doesnt sell any of the rings :S and rings are working just fine when i summon them
 
npc.lua
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)              npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)           npcHandler:onCreatureDisappear(cid)         end
function onCreatureSay(cid, type, msg)      npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                          npcHandler:onThink()                        end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'overmind mage ring'}, 30439, 3000000, 1, 'overmind mage ring')
shopModule:addBuyableItem({'overmind heavy ring'}, 30438, 3000000, 1, 'overmind heavy ring')
shopModule:addBuyableItem({'overflow energy ring'}, 30442, 1500000, 1, 'overflow energy ring')
shopModule:addBuyableItem({'boss egg'}, 30170, 30000000, 1, 'boss egg')

--[[function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end

    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)]]
npcHandler:addModule(FocusModule:new())
 
npc.lua
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)              npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)           npcHandler:onCreatureDisappear(cid)         end
function onCreatureSay(cid, type, msg)      npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                          npcHandler:onThink()                        end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'overmind mage ring'}, 30439, 3000000, 1, 'overmind mage ring')
shopModule:addBuyableItem({'overmind heavy ring'}, 30438, 3000000, 1, 'overmind heavy ring')
shopModule:addBuyableItem({'overflow energy ring'}, 30442, 1500000, 1, 'overflow energy ring')
shopModule:addBuyableItem({'boss egg'}, 30170, 30000000, 1, 'boss egg')

--[[function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end

    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)]]
npcHandler:addModule(FocusModule:new())
Still the same problem T.T
 
Setup other items, like crown set and check it works. If it works then problem is with your new item ID.
I copy you NPC, change item ID to mine "new" item ID. And its working perfect.
f13021128f966106d24dc902bcabb714.jpeg


Check item.otb, cuz maybe you use CID instead of SID.
 
Setup other items, like crown set and check it works. If it works then problem is with your new item ID.
I copy you NPC, change item ID to mine "new" item ID. And its working perfect.
f13021128f966106d24dc902bcabb714.jpeg


Check item.otb, cuz maybe you use CID instead of SID.
Hello, could you tell me what is CID and SID? im watching the rings in items.otb and everything seem normal
 
Setup other items, like crown set and check it works. If it works then problem is with your new item ID.
I copy you NPC, change item ID to mine "new" item ID. And its working perfect.
f13021128f966106d24dc902bcabb714.jpeg


Check item.otb, cuz maybe you use CID instead of SID.
I am soo stealing your sprites! (Joking of course ;))
 
SID - Server ID
CID - Client ID

1. In item editor you have two ID, CID and SID.
SID is generated automatically when you add new item in itemeditor.
CID you setup here to make connection with client, paste number from step 2.
389143fccabf326eb93a89894eeaf38f.jpeg

2. In ObcjectBuilder, when you add new item, they automatically generated new CID, this new CID you paste in first step.
f15107f765332a9db0554bfa6ffeea2b.jpeg

3. In items.xml you setup the SID.
866e0711dbb5ca31020c7b7e92910265.jpeg
 
Back
Top