Hultin
Member
- Joined
- Dec 2, 2008
- Messages
- 262
- Reaction score
- 17
Here is my error:
And here is my NPC code:
I've tried to fix this myself, but I just cannot seem to figure out what's wrong.
I do know what EOF means, End Of File.
I'm using the latest TFS 3.
PHP:
[30/06/2010 20:29:02] [Error - LuaScriptInterface::loadFile] data/npc/scripts/blessings/first.lua:21: 'end' expected (to close 'function' at line 9) near '<eof>'
[30/06/2010 20:29:02] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/blessings/first.lua
[30/06/2010 20:29:02] data/npc/scripts/blessings/first.lua:21: 'end' expected (to close 'function' at line 9) near '<eof>'
And here is my NPC code:
PHP:
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()
if getPlayerLevel(cid) < 31 then
cost = 2000
elseif(getPlayerLevel(cid) > 30 and getPlayerLevel(cid) < 121) then
cost = ((getPlayerLevel(cid) - 30) * 200) + 2000
elseif(getPlayerLevel(cid) > 120) then
cost = 20000
end
local node1 = keywordHandler:addKeyword({'blessing'}, StdModule.say, {npcHandle = npcHandler, onlyFocus = true, text = 'There are five blessings of this world. {Sanctifaction}, {Kings}, {Hope}, {Strength} and {Phoenix}'})
local node2 = keywordHandler:addKeyword({'Strength'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can grant you blessing of Strengith for a sacrifice of '.. cost ..' gold. Do you wish to get blessed?'})
node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 1, premium = false, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I cannot help you without a sacrifice to the gods!'})
I've tried to fix this myself, but I just cannot seem to figure out what's wrong.
I do know what EOF means, End Of File.
I'm using the latest TFS 3.