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

Lua NPC wont respond

Frillinde

Founder: Another Realm
Joined
Jan 16, 2012
Messages
148
Reaction score
3
Location
his computer
crying damson 3.6pl1 8.54
i get no errors in console but he wont respond after "Hi"


script:
Lua:
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()					npcHandler:onThink() end
 
local config = {
quest_one = 34450,
quest_two = 34451,
quest_three = 34452,
quest_four = 34453,
quest_five = 34454,
quest_six = 34455,
quest_seven = 34456,
quest_eight = 34457,
quest_nine = 34458,
quest_ten = 34459,
quest_eleven = 34460,
quest_twelve = 34461,
quest_thirteen = 34462
}
 
local reward = {
rew_one = 10000, --exp value gained for each quest complete, better to edit it as you like
rew_two = 80000,
rew_three = 150000,
rew_four = 250000,
rew_five = 350000,
rew_six = 450000,
rew_seven = 550000,
rew_eight = 650000,
rew_nine = 750000,
rew_ten = 850000,
rew_eleven = 950000,
rew_twelve = 1500000,
rew_thirteen = 3000000
}
 
function creatureSayCallback(cid, type, msg)
	if(not npcHandler:isFocused(cid)) then
		return false
	end
 
 	if msgcontains(msg, 'tutor quest') then
		selfSay('Would you like to finish the Tutor Quest now?', cid)
	elseif msgcontains(msg, 'yes') then
		if (getPlayerLevel(cid) >= 50) then	
		selfSay('Ok then, You need to answer a few questions first, ok?', cid)
			talk_state = 1
		else
			selfSay('Sorry I didn\'t understand. Would you like to start the Tutor Quest?', cid)
			talk_state = 0
		end
	elseif msgcontains(msg, 'ok') and talk_state == 1 then
		talk_state = 0
        if getCreatureStorage(cid, config.quest_thirteen) == 1 == TRUE then
			selfSay('What is the name of our server we play on?', cid)
			elseif msgcontains(msg, 'Another Realm') then
				selfSay('Correct. Who was the creator of this map?', cid)
				elseif msgcontains(msg, 'Frillinde') then
					selfSay('Also correct.What is the name of the map we on?', cid)
					elseif msgcontains(msg, 'Lands of Argatha') then
						selfSay('Wow, another correct answer.You should pass this test easy. What is our capital city?', cid)
						elseif msgcontains(msg, 'Corum') then
							selfSay('Good answer. Who is our king?', cid)
							elseif msgcontains(msg, 'King Morellon') then
								selfSay('Correct. What city lies in the desert?', cid)
								elseif msgcontains(msg, 'Sambo.') then
									selfSay('Well done. Only 3 questions left. True or false...A tutor should set a moral example for others.', cid)
									elseif msgcontains(msg, 'true') then
										selfSay('Right. What is our coldest city?', cid)
										elseif msgcontains(msg, 'ebanor') then
											selfSay('Correct. Last question, is super easy too. Who is the most awesome character on this server?', cid)
											elseif msgcontains(msg, 'Frillinde') then
												selfSay('Congradulations. You have passed the Tutor Quest and are now a tutor', cid)
												setPlayerGroupId(cid, 2)
											elseif msgcontains(msg, 'me') then
												selfSay('YOU? You have no clue. Your Tutor Quest has been reset. Please go see Wallin in Corum to begin this quest', cid)
												setPlayerStorageValue(cid, quest_one, 0)
												setPlayerStorageValue(cid, quest_two, 0)
												setPlayerStorageValue(cid, quest_three, 0)
												setPlayerStorageValue(cid, quest_four, 0)
												setPlayerStorageValue(cid, quest_five, 0)
												setPlayerStorageValue(cid, quest_six, 0)
												setPlayerStorageValue(cid, quest_seven, 0)
												setPlayerStorageValue(cid, quest_eight, 0)
												setPlayerStorageValue(cid, quest_nine, 0)
												setPlayerStorageValue(cid, quest_ten, 0)
												setPlayerStorageValue(cid, quest_eleven, 0)
												setPlayerStorageValue(cid, quest_twelve, 0)
												setPlayerStorageValue(cid, quest_thirteen, 0)
		end
	elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 10) then
		selfSay('I\'m sorry but I can\'t help you right now.')
		talk_state = 0
	end
	return true
 end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Any help is appreciated ;p
 
Back
Top