Ward_214
Pro PvP
- Joined
- Dec 11, 2008
- Messages
- 297
- Reaction score
- 0
Okay...
Im getting this error in the console
This is the script:
Im getting this error in the console
Code:
[31/07/2011 05:17:46] [Error - LuaScriptInterface::loadFile] data/npc/scripts/donors1.lua:40: '<eof>' expected near 'npcHandler'
[31/07/2011 05:17:46] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/donors1.lua
This is the script:
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|. I buy Kiwi tokens for donator items! I can sell you a {Crusader Armor}.")
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'crusader armor') or msgcontains(msg, 'crus armor')) then
selfSay('Do you want to buy a Crusader Armor for 2 Kiwi tokens?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if doPlayerRemoveItem(cid, 6527, 2) == true then doPlayerAddItem(cid, 2053, 1)
selfSay('Here you are.', cid)
else
end
else
selfSay('Sorry, you don\'t have enough Kiwi Tokens.', cid)
end
end
talkState[talkUser] = 0
if(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok then.', cid)
end
return true
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())