[Error - LuaInterface::loadFile] data/npc/scripts/Bron.lua:22: 'end' expected (to close 'function' at line 10) near 'elseif'
[Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/Bron.lua
data/npc/scripts/Bron.lua:22: 'end' expected (to close 'function' at line 10) near 'elseif'
WTF??? Please help me for Rep ;D
[Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/Bron.lua
data/npc/scripts/Bron.lua:22: 'end' expected (to close 'function' at line 10) near 'elseif'
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local Topic = {}
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local storage = getPlayerStorageValue(cid, 22124)
if msgcontains(msg, 'violence') then
npcHandler:say("Convincing Ajax that it is not always necessary to use brute force... this would be such an achievement. Definitely a hard task though. ...", cid)
npcHandler:say("Listen, I simply have to ask, maybe a stranger can influence him better than I can. Would you help me with my brother?", cid)
Topic[talkUser] = 1
end
elseif msgcontains(msg, 'yes') and Topic[talkUser] == 1 then
npcHandler:say("Really! That is such an incredibly nice offer! I already have a plan. You have to teach him that sometimes words are stronger than fists. ...", cid)
npcHandler:say("Maybe you can provoke him with something to get angry, like saying... 'MINE!' or something. But beware, I'm sure that he will try to hit you. ...", cid)
npcHandler:say("Don't do this if you feel weak or ill. He will probably want to make you leave by using violence, but just stay strong and refuse to give up. ...", cid)
npcHandler:say("If he should ask what else is necessary to make you leave, tell him to 'say please'. Afterwards, do leave and return to him one hour later. ...", cid)
npcHandler:say("This way he might learn that violence doesn't always help, but that a friendly word might just do the trick. ...", cid)
npcHandler:say("Have you understood everything I told you and are really willing to take this risk?", cid)
Topic[talkUser] = 2
elseif msgcontains(msg, 'yes') and Topic[talkUser] == 2 then
if storage == -1 then
npcHandler:say("You are indeed not only well educated, but also very courageous. I wish you good luck, you are my last hope.", cid)
setPlayerStorageValue(cid, 22124, 1)
Topic[talkUser] = 0
end
elseif msgcontains(msg, '"Brother is right. Fist not always good."') then
npcHandler:say("Oh! He really said that? I am so proud of you, Gracz. These are really good news. Everything would be great... if only there wasn't this person near my house.", cid)
Topic[talkUser] = 3
elseif msgcontains(msg, 'person') and Topic[talkUser] == 3 then
if storage == 3 then
npcHandler:say("This... person... makes me want to... say something bad... must... control myself. <sweats> I really don't know what to do anymore....", cid)
npcHandler:say("I wonder if Ajax has an idea. Could you ask him about Gelagos?", cid)
Topic[talkUser] = 4
end
elseif msgcontains(msg, 'person') and Topic[talkUser] == 4 then
npcHandler:say("Again, I have to thank you for your selfless offer to help me. I hope that Ajax can come up with something, now that he has experienced the power of words.", cid)
setPlayerStorageValue(cid, 22124, 4)
Topic[talkUser] = 0
else
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
WTF??? Please help me for Rep ;D
Last edited: