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

HOTA Npc

Beo

Three Magic
Joined
Aug 25, 2009
Messages
9,059
Solutions
1
Reaction score
846
Hey,
I need an NPC that you trade all the pieces of HOTA and they give you the helmet.

Rep+ Of course.


P.s
Didn't know if this was the correct place.
 
Code:
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, "yes") then
		local items = {1, 2, 3, 4, 5, 6, 7}
		local has
		for i = 1, #items do
			if getPlayerItemCount(cid, items[i]) < 1 then
				npcHandler:say("You dont have the required items.", cid)
				break
			end
			has = true
		end
		if has then
			for i = 1, #items do
				doPlayerRemoveItem(cid, items[i], 1)
			end
			doPlayerAddItem(cid, ur_item_id, 1)
		end
	end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top