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

Solved I could need some help with a NPC sell/buy script!

Lunarzz

New Member
Joined
Jan 23, 2015
Messages
45
Reaction score
0
Hello, i am pretty new in using scripts in a Linux Server, my server is based on the client 8.6 and is 0.3.6

I made the offers myself, they worked clearly on a Windows based server sadly it did not work on my Linux so I will show you my script! :) As the script does not accept stacked items, in example "100 small rubies does not work to sell as it says "You do not have this object" But it work's to sell 1 and 1, but not stacked!
Any help would be really appreciated!

\/ NPC script

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

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

shopModule:addSellableItem({'zaoan shoes'}, 11303, 5000, 'zaoan shoes')
shopModule:addSellableItem({'zaoan legs'}, 11304, 14000, 'zaoan legs')
shopModule:addSellableItem({'zaoan helmet'}, 11302, 45000, 'zaoan helmet')
shopModule:addSellableItem({'zaoan armor'}, 11301, 14000, 'zaoan armor')
shopModule:addSellableItem({'warmasters wristguards'}, 11322, 200, 'warmasters wristguards')
shopModule:addSellableItem({'spiked iron ball'}, 11325, 100, 'spiked iron ball')
shopModule:addSellableItem({'sai'}, 11306, 16500, 'sai')
shopModule:addSellableItem({'high guard shoulderplates'}, 11333, 130, 'high guard shoulderplates')
shopModule:addSellableItem({'guardian boots'}, 11240, 35000, 'guardian boots')
shopModule:addSellableItem({'elite draken mail'}, 12728, 50000, 'elite draken mail')
shopModule:addSellableItem({'drakinata'}, 11305, 10000, 'drakinata')
shopModule:addSellableItem({'draken boots'}, 12767, 40000, 'draken boots')
shopModule:addSellableItem({'drachaku'}, 11308, 10000, 'drachaku')
shopModule:addSellableItem({'cursed shoulders spikes'}, 11327, 320, 'cursed shoulders spikes')
shopModule:addSellableItem({'broken halberd'}, 11335, 100, 'broken halberd')
shopModule:addSellableItem({'zaogun shoulderplate'}, 11331, 350, 'zaogun shoulderplate')
shopModule:addSellableItem({'bone shoulderplates'}, 11321, 150, 'bone shoulderplates')
shopModule:addSellableItem({'weaver wandtip'}, 11314, 250, 'weaver wandtip')
shopModule:addSellableItem({'scale of corruption'}, 12750, 680, 'scale of corruption')
shopModule:addSellableItem({'eye of corruption'}, 12748, 390, 'eye of corruption')
shopModule:addSellableItem({'tail of corruption'}, 12749, 240, 'tail of corruption')

npcHandler:addModule(FocusModule:new())

^ This it the script that the NPC loads



Kind regards, Lunar
 
You can try using this modules (data/npc/lib/npcsystem/modules.lua).
http://www.speedy*****malware.localhost/2n5dC/modules.lua
 
You can try using this modules (data/npc/lib/npcsystem/modules.lua).
http://www.speedy*****malware.localhost/2n5dC/modules.lua
Thanks I did not understand really much, but I will read through it and try my best before asking for more help :) I appreciate it rep+++!!!

I got another problem, sorry to bother you and if you do not wan't to help me or you can't then i'm happy anyways! :)
The problem is that in example if i have 500 manapotions in the backpack and uses them from the hotkeys it will just say that i have 100 manas (1 stack) It does not count stacked items.



Thanks in advance, Lunar!
 
Back
Top