Hello everybody! Can someone fix this error:
THIS IS ERROR IN GUI
CODE:
Thanks
THIS IS ERROR IN GUI
PHP:
[04/10/2008 22:00:13] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/enchantowanie.lua
[04/10/2008 22:00:13] data/npc/scripts/enchantowanie.lua:97: '<eof>' expected near 'end'
[04/10/2008 22:00:14] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/enchantowanie.lua
[04/10/2008 22:00:14] data/npc/scripts/enchantowanie.lua:97: '<eof>' expected near 'end'
CODE:
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
-- use the real conversation? (true/false)
tradeMsg = 'I can enchant some items like... Small sapphire for enchanted small sapphire'
sapphire = 'Do you want to enchant small sapphire?'
ruby = 'Do you want to enchant small ruby?'
emerald = 'Do you want to enchant small emerald?'
amethyst = 'Do you want to enchant small amethyst?'
hasNoMsg = 'Come back when you have more!'
noMsg = 'Ok than.'
end
if msgcontains(msg, 'items') or msgcontains(msg, 'item') or msgcontains(msg, 'enchant') then
selfSay(tradeMsg)
elseif msgcontains(msg, 'small sapphire') or msgcontains(msg, 'sapphire') or msgcontains(msg, 'enchant small sapphire') then
selfSay(sapphire)
talk_state = 1
elseif msgcontains(msg, 'small ruby') or msgcontains(msg, 'ruby') or msgcontains(msg, 'enchant small ruby') then
selfSay(ruby)
talk_state = 2
elseif msgcontains(msg, 'small emerald') or msgcontains(msg, 'emerald') or msgcontains(msg, 'enchant small emerald') then
selfSay(emerald)
talk_state = 3
elseif msgcontains(msg, 'small amethyst') or msgcontains(msg, 'amethyst') or msgcontains(msg, 'enchant small amethyst') then
selfSay(amethyst)
talk_state = 4
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerItemCount(cid,2146) >= 1 then
if doPlayerTakeItem(cid,2146,1) == 0 then
selfSay('Here you are.')
doPlayerAddItem(cid,7759,1)
end
else
selfSay(hasNoMsg)
end
talk_state = 0
elseif msgcontains(msg, 'yes') and talk_state == 2 then
if getPlayerItemCount(cid,2147) >= 1 then
if doPlayerTakeItem(cid,2147,1) == 0 then
selfSay('Here you are.')
doPlayerAddItem(cid,7760,1)
end
else
selfSay(hasNoMsg)
end
talk_state = 0
elseif msgcontains(msg, 'yes') and talk_state == 3 then
if getPlayerItemCount(cid,2149) >= 1 then
if doPlayerTakeItem(cid,2149,1) == 0 then
selfSay('Here you are.')
doPlayerAddItem(cid,7761,1)
end
else
selfSay(hasNoMsg)
end
talk_state = 0
elseif msgcontains(msg, 'yes') and talk_state == 4 then
if getPlayerItemCount(cid,2150) >= 1 then
if doPlayerTakeItem(cid,2150,1) == 0 then
selfSay('Here you are.')
doPlayerAddItem(cid,7762,1)
end
else
selfSay(hasNoMsg)
end
talk_state = 0
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 4) then
selfSay(noMsg)
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Thanks