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

Lua Forgotten server 8.6 map NPC failure

Raukohin

New Member
Joined
Jun 17, 2015
Messages
28
Reaction score
3
I cant figure out how to get this npc to work, its a dowload i found but i edited the name and list of buy/sellable items and thats all, whenever i boot up the server i get an error message and the npc doesnt spawn, here is the error message:

[18/06/2015 17:17:43] [Error - LuaScriptInterface::loadFile] data/npc/scripts/entrepreneur.lua:14: ')' expected near ''Amulet of Loss''
[18/06/2015 17:17:43] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/entrepreneur.lua
[18/06/2015 17:17:43] data/npc/scripts/entrepreneur.lua:14: ')' expected near ''Amulet of Loss''

ive tried deleting the entire line of code and it just moves down the list onto the next item and says essentially the same thing, so i figure it must be a problem with either the xml or the script itself, here is the code in the xml file

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Entrepreneur" script="data/npc/scripts/entrepreneur.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="134" head="58" body="63" legs="60" feet="76" addons="2"/>
</npc>


and here is the LUA

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

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)

*(this part was too long to copy so im just going to include 1 example of a buyable item and 1 example of a sellable item)*

shopModule:addBuyableItem({'Amulet of Loss'}, 2173, 50000, 1'Amulet of Loss')

shopModule:addSellableItem({'crown helmet'}, 2491, 2500, 1,'crown helmet')


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


In the actual file the list of sellable items is massive, nearly every item i could find.
if anyone can help me solve this problem i would be greatly appreciative
 
After the 1 is a comma missing

shopModule:addBuyableItem({'Amulet of Loss'}, 2173, 50000, 1'Amulet of Loss')

shopModule:addBuyableItem({'Amulet of Loss'}, 2173, 50000, 1,'Amulet of Loss')
 
Back
Top