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

Need to fix this npc, REP ++

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello.

Error:
[09/08/2010 21:31:26] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/artifact.lua
[09/08/2010 21:31:26] data/npc/scripts/artifact.lua:19: ')' expected near 'then'

Script:
PHP:
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

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, '1 broken artifact') or (msgcontains(msg, 'mystic box of ve') then
                selfSay('Do you want to change your {1 broken artifact} for {mystic box of ve} ?', cid)
                talkState[talkUser] = 1
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
                if(getPlayerItemCount(cid, 10684) >= 1 then
                        if(doPlayerRemoveItem(cid, 10684, 1) or doPlayerRemoveItem(cid, 10684, 1) then
                                doPlayerAddItem(cid, 10840, 1)
                                selfSay('Here you are.', cid)
                        else
                                selfSay('Sorry, you don\'t have {1 broken artifact}!', cid)
                        end
                end
        if(msgcontains(msg, '10 broken artifact') or (msgcontains(msg, 'mystic box of tha') then
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of tha} ?', cid)
                talkState[talkUser] = 1
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
                if(getPlayerItemCount(cid, 10684) >= 10 then
                        if(doPlayerRemoveItem(cid, 10684, 10) or doPlayerRemoveItem(cid, 10684, 10) then
                                doPlayerAddItem(cid, 10839, 1)
                                selfSay('Here you are.', cid)
                        else
                                selfSay('Sorry, you don\'t have {10 broken artifacts}!', cid)
                        end
                end
        if(msgcontains(msg, '15 broken artifact') or (msgcontains(msg, 'mystic box of car') then
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of car} ?', cid)
                talkState[talkUser] = 1
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
                if(getPlayerItemCount(cid, 10684) >= 15 then
                        if(doPlayerRemoveItem(cid, 10684, 15) or doPlayerRemoveItem(cid, 10684, 15) then
                                doPlayerAddItem(cid, 10841, 1)
                                selfSay('Here you are.', cid)
                        else
                                selfSay('Sorry, you don\'t have {15 broken artifacts}!', cid)
                        end
                end
        if(msgcontains(msg, '25 broken artifact') or (msgcontains(msg, 'mystic box of aB') then
                selfSay('Do you want to change your {25 broken artifacts} for {mystic box of aB} ?', cid)
                talkState[talkUser] = 1
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
                if(getPlayerItemCount(cid, 10684) >= 25 then
                        if(doPlayerRemoveItem(cid, 10684, 25) or doPlayerRemoveItem(cid, 10684, 25) then
                                doPlayerAddItem(cid, 10842, 1)
                                selfSay('Here you are.', cid)
                        else
                                selfSay('Sorry, you don\'t have {25 broken artifacts}!', cid)
                        end
                end
                talkState[talkUser] = 0
        elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then
                talkState[talkUser] = 0
                selfSay('Ok then.', cid)
        end

        return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
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 

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, '1 broken artifact') or msgcontains(msg, 'mystic box of ve')) then 
                selfSay('Do you want to change your {1 broken artifact} for {mystic box of ve} ?', cid) 
                talkState[talkUser] = 1 
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then 
                if(getPlayerItemCount(cid, 10684) >= 1 then 
                        if(doPlayerRemoveItem(cid, 10684, 1) or doPlayerRemoveItem(cid, 10684, 1) then 
                                doPlayerAddItem(cid, 10840, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {1 broken artifact}!', cid) 
                        end 
                end 
        if(msgcontains(msg, '10 broken artifact') or (msgcontains(msg, 'mystic box of tha') then 
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of tha} ?', cid) 
                talkState[talkUser] = 1 
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then 
                if(getPlayerItemCount(cid, 10684) >= 10 then 
                        if(doPlayerRemoveItem(cid, 10684, 10) or doPlayerRemoveItem(cid, 10684, 10) then 
                                doPlayerAddItem(cid, 10839, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {10 broken artifacts}!', cid) 
                        end 
                end 
        if(msgcontains(msg, '15 broken artifact') or (msgcontains(msg, 'mystic box of car') then 
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of car} ?', cid) 
                talkState[talkUser] = 1 
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then 
                if(getPlayerItemCount(cid, 10684) >= 15 then 
                        if(doPlayerRemoveItem(cid, 10684, 15) or doPlayerRemoveItem(cid, 10684, 15) then 
                                doPlayerAddItem(cid, 10841, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {15 broken artifacts}!', cid) 
                        end 
                end 
        if(msgcontains(msg, '25 broken artifact') or (msgcontains(msg, 'mystic box of aB') then 
                selfSay('Do you want to change your {25 broken artifacts} for {mystic box of aB} ?', cid) 
                talkState[talkUser] = 1 
        elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then 
                if(getPlayerItemCount(cid, 10684) >= 25 then 
                        if(doPlayerRemoveItem(cid, 10684, 25) or doPlayerRemoveItem(cid, 10684, 25) then 
                                doPlayerAddItem(cid, 10842, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {25 broken artifacts}!', cid) 
                        end 
                end 
                talkState[talkUser] = 0 
        elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then 
                talkState[talkUser] = 0 
                selfSay('Ok then.', cid) 
        end 

        return true 
end 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
 
NExt errors:
PHP:
[10/08/2010 12:08:20] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/artifact.lua
[10/08/2010 12:08:20] data/npc/scripts/artifact.lua:22: ')' expected near 'then'
 
try this [it had many typing error i fixed]
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 
 
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, '1 broken artifact') or msgcontains(msg, 'mystic box of ve')) then 
                selfSay('Do you want to change your {1 broken artifact} for {mystic box of ve} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 1 then 
                        if(doPlayerRemoveItem(cid, 10684, 1) or doPlayerRemoveItem(cid, 10684, 1) then 
                                doPlayerAddItem(cid, 10840, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {1 broken artifact}!', cid) 
                        end 
                end 
        if msgcontains(msg, '10 broken artifact') or msgcontains(msg, 'mystic box of tha') then 
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of tha} ?', cid) 
                talkState[talkUser] = 1 
        elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then 
                if getPlayerItemCount(cid, 10684) >= 10 then 
                        if doPlayerRemoveItem(cid, 10684, 10) or doPlayerRemoveItem(cid, 10684, 10) then 
                                doPlayerAddItem(cid, 10839, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {10 broken artifacts}!', cid) 
                        end 
                end 
        if msgcontains(msg, '15 broken artifact') or msgcontains(msg, 'mystic box of car') then 
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of car} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 15 then 
                        if doPlayerRemoveItem(cid, 10684, 15) or doPlayerRemoveItem(cid, 10684, 15) then 
                                doPlayerAddItem(cid, 10841, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {15 broken artifacts}!', cid) 
                        end 
                end 
        if msgcontains(msg, '25 broken artifact') or msgcontains(msg, 'mystic box of aB') then 
                selfSay('Do you want to change your {25 broken artifacts} for {mystic box of aB} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 25 then 
                        if doPlayerRemoveItem(cid, 10684, 25) or doPlayerRemoveItem(cid, 10684, 25) then 
                                doPlayerAddItem(cid, 10842, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {25 broken artifacts}!', cid) 
                        end 
                end 
                talkState[talkUser] = 0 
        elseif msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) then 
                talkState[talkUser] = 0 
                selfSay('Ok then.', cid) 
        end 
 
        return true 
end 
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
 
hmm...

[10/08/2010 12:24:57] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/artifact.lua
[10/08/2010 12:24:57] data/npc/scripts/artifact.lua:23: ')' expected near 'then'
 
Dude f**k**g learn to read. They error code is so obvious that you see what is wrong directly...
 
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 
 
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, '1 broken artifact') or msgcontains(msg, 'mystic box of ve') then 
                selfSay('Do you want to change your {1 broken artifact} for {mystic box of ve} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 1 then 
                        if doPlayerRemoveItem(cid, 10684, 1) or doPlayerRemoveItem(cid, 10684, 1) then 
                                doPlayerAddItem(cid, 10840, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {1 broken artifact}!', cid) 
                        end 
                end 
        if msgcontains(msg, '10 broken artifact') or msgcontains(msg, 'mystic box of tha') then 
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of tha} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 10 then 
                        if doPlayerRemoveItem(cid, 10684, 10) or doPlayerRemoveItem(cid, 10684, 10) then 
                                doPlayerAddItem(cid, 10839, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {10 broken artifacts}!', cid) 
                        end 
                end 
        if msgcontains(msg, '15 broken artifact') or msgcontains(msg, 'mystic box of car') then 
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of car} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 15 then 
                        if doPlayerRemoveItem(cid, 10684, 15) or doPlayerRemoveItem(cid, 10684, 15) then 
                                doPlayerAddItem(cid, 10841, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {15 broken artifacts}!', cid) 
                        end 
                end 
        if msgcontains(msg, '25 broken artifact') or msgcontains(msg, 'mystic box of aB') then 
                selfSay('Do you want to change your {25 broken artifacts} for {mystic box of aB} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 25 then 
                        if doPlayerRemoveItem(cid, 10684, 25) or doPlayerRemoveItem(cid, 10684, 25) then 
                                doPlayerAddItem(cid, 10842, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {25 broken artifacts}!', cid) 
                        end 
                end 
                talkState[talkUser] = 0 
        elseif msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) then 
                talkState[talkUser] = 0 
                selfSay('Ok then.', cid) 
        end 
 
        return true 
end 
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
 
[10/08/2010 12:41:24] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/artifact.lua
[10/08/2010 12:41:24] data/npc/scripts/artifact.lua:76: 'end' expected (to close 'if' at line 30) near '<eof>'

ehhh
 
Try. Btw. I hate npc scripts, I've never been good at them.
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 
 
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, '1 broken artifact') or msgcontains(msg, 'mystic box of ve') then 
                selfSay('Do you want to change your {1 broken artifact} for {mystic box of ve} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 1 then 
                        if doPlayerRemoveItem(cid, 10684, 1) or doPlayerRemoveItem(cid, 10684, 1) then 
                                doPlayerAddItem(cid, 10840, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {1 broken artifact}!', cid) 
                        end 
                end 
		end
        if msgcontains(msg, '10 broken artifact') or msgcontains(msg, 'mystic box of tha') then 
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of tha} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 10 then 
                        if doPlayerRemoveItem(cid, 10684, 10) or doPlayerRemoveItem(cid, 10684, 10) then 
                                doPlayerAddItem(cid, 10839, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {10 broken artifacts}!', cid) 
                        end 
                end 
		end
        if msgcontains(msg, '15 broken artifact') or msgcontains(msg, 'mystic box of car') then 
                selfSay('Do you want to change your {10 broken artifacts} for {mystic box of car} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 15 then 
                        if doPlayerRemoveItem(cid, 10684, 15) or doPlayerRemoveItem(cid, 10684, 15) then 
                                doPlayerAddItem(cid, 10841, 1) 
                                selfSay('Here you are.', cid) 
                        else 
                                selfSay('Sorry, you don\'t have {15 broken artifacts}!', cid) 
                        end 
                end 
		end
        if msgcontains(msg, '25 broken artifact') or msgcontains(msg, 'mystic box of aB') then 
                selfSay('Do you want to change your {25 broken artifacts} for {mystic box of aB} ?', cid) 
                talkState[talkUser] = 1 
        elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then 
                if getPlayerItemCount(cid, 10684) >= 25 then 
                        if doPlayerRemoveItem(cid, 10684, 25) or doPlayerRemoveItem(cid, 10684, 25) then 
                                doPlayerAddItem(cid, 10842, 1) 
                                selfSay('Here you are.', cid) 
								                talkState[talkUser] = 0 
                        else 
                                selfSay('Sorry, you don\'t have {25 broken artifacts}!', cid) 
								                talkState[talkUser] = 0 
                        end 
                end 
        elseif msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) then 
                talkState[talkUser] = 0 
                selfSay('Ok then.', cid) 
        end 
 
        return true 
end 
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
 
Last edited:
fixed? :p
Code:
local keywordHandler = KeywordHandler:new() 
local npcHandler = NpcHandler:new(keywordHandler) 
NpcSystem.parseParameters(npcHandler) 
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 greetCallback(cid)
	Topic[cid] = 0
	return true
end

function creatureSayCallback(cid, type, msg) 
	if not npcHandler:isFocused(cid) then 
		return false 
	elseif msgcontains(msg, '1 broken artifact') or msgcontains(msg, 'mystic box of ve') then 
		selfSay('Do you want to change your {1 broken artifact} for {mystic box of ve} ?', cid) 
		Topic[cid] = 1 
	elseif msgcontains(msg, 'yes') and Topic[cid] == 1 then 
		if doPlayerRemoveItem(cid, 10684, 1) then
			doPlayerAddItem(cid, 10840, 1)
			selfSay('Here you are.', cid)
		else
			selfSay('Sorry, you don\'t have {1 broken artifact}!', cid)
		end
	elseif msgcontains(msg, '10 broken artifact') or msgcontains(msg, 'mystic box of tha') then
		selfSay('Do you want to change your {10 broken artifacts} for {mystic box of tha} ?', cid)
		Topic[cid] = 2
	elseif msgcontains(msg, 'yes') and Topic[cid] == 2 then
		if doPlayerRemoveItem(cid, 10684, 10) then
			doPlayerAddItem(cid, 10839, 1)
			selfSay('Here you are.', cid)
		else
			selfSay('Sorry, you don\'t have {10 broken artifacts}!', cid)
		end
	elseif msgcontains(msg, '15 broken artifact') or msgcontains(msg, 'mystic box of car') then
		selfSay('Do you want to change your {10 broken artifacts} for {mystic box of car} ?', cid)
		Topic[cid] = 3
	elseif msgcontains(msg, 'yes') and Topic[cid] == 3 then 
		if doPlayerRemoveItem(cid, 10684, 15) then 
			doPlayerAddItem(cid, 10841, 1)
			selfSay('Here you are.', cid)
		else
			selfSay('Sorry, you don\'t have {15 broken artifacts}!', cid)
		end
	elseif msgcontains(msg, '25 broken artifact') or msgcontains(msg, 'mystic box of aB') then
		selfSay('Do you want to change your {25 broken artifacts} for {mystic box of aB} ?', cid)
		Topic[cid] = 4
	elseif msgcontains(msg, 'yes') and Topic[cid] == 4 then
		if doPlayerRemoveItem(cid, 10684, 25) then
			doPlayerAddItem(cid, 10842, 1)
			selfSay('Here you are.', cid)
		else
			selfSay('Sorry, you don\'t have {25 broken artifacts}!', cid)
		end
		Topic[cid] = 0
	elseif msgcontains(msg, 'no') and Topic[cid] > 0 then
		Topic[cid] = 0
		selfSay('Ok then.', cid)
	end
	return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
aff, the new code tags suck.
 
Back
Top