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

Three Npc

Elexonic

Well-Known Member
Joined
Jun 18, 2008
Messages
1,920
Reaction score
59
1--
What I need is an npc for a mission .. and when you complete a prize you more experience and can use only one you see therefore that of a storage ..
What I want to say is

Player - Hi
Npc - Hello blabla help me?
player - mission or yes
npc - Ok you need to get me through blah blah ..

when you bring me the item to npc
hi
mission
the npc I remove the item and give me my other items (2160) and 300 experience



2.------------------

And the other training npc sword that you upload a prize.
hi
mission
.
if you have sword 50, the award will>> (2160 x 5)
if you have sword 70, the award will>> (2160 x 10)
if you have sword 90, the award will>> (2160 x 15)
sword if you have 100, give you award>> (2160 x 20)

3--
An NPC that premium acount for 30 days in exchange for 60cc

the npc you 30 days of premium and you remove 60cc (2160 x 60)

I hope someone knows how to do
thanks
 
-- Premmy --

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, 'premium') or msgcontains(msg, 'premmy') then
		npcHandler:say('Would you like to buy 30 premium days for 60 crystal coins?', cid) else
	if msgcontains(msg, 'yes') and
		doPlayerRemoveMoney(cid, 600000) then
		npcHandler:say('Here you are.', cid)
		doPlayerAddPremiumDays(cid, 30) else
		npcHandler:say('You do not have enough money', cid)
	if msgcontains(msg, 'no') then
		npcHandler:say('Then not.')
	end
	return true
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Thank you very much: D
The only thing bad that happens is that if you tell for example:
aa
SSAD
xf

npc anything the answers you and says

You Do not have enough money
how I can fix that?
Thanks
 
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 creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	elseif msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then
		npcHandler:say('Would you like to buy 30 premium days for 60 crystal coins?', cid)
		Topic[cid] = 1
	elseif Topic[cid] == 1 then
		if msgcontains(msg, 'yes') then
			if doPlayerRemoveMoney(cid, 600000) then
				npcHandler:say('Here you are.', cid)
				doPlayerAddPremiumDays(cid, 30)
			else
				npcHandler:say('You don\'t have enough money.', cid)
			end
		else
			npcHandler:say('Then not.')
		end
		Topic[cid] = 0
	end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
O only need npc 2º

And the other training npc sword that you upload a prize.
hi
mission
.
if you have sword 50, the award will>> (2160 x 5)
if you have sword 70, the award will>> (2160 x 10)
if you have sword 90, the award will>> (2160 x 15)
sword if you have 100, give you award>> (2160 x 20)
 
Back
Top