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

[Request] NPC

Azulzaniel

OMG :D
Joined
Nov 17, 2008
Messages
5
Reaction score
0
Location
Poland/Spain
Hello i need a npc that sell outfits for money and that also can change the outfit of the players and keep the outfit to work after relog. I am using 7.92 OT zorzin ot

Something like this
Hello "player name" i sell ghoul,necromance, monk, kongra, troll, vampire,elf,tiger and skeleton outfit for 50 cc each one

Can you tell me if there is a similar npc already done?, because i dont know make scripts :/

sorry for my English.
 
Last edited:
Necromancer Outfit, maybe you can learn from this and do the rest. :thumbup:

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
	end
	
	local cost = 500000
	if msgcontains(msg, "necro") or  msgcontains(msg, "necromancer") then
		if getPlayerMoney(cid) >= cost then
			npcHandler:say("Would you like to purchase the {Necromancer} outfit for 50 crystal coin's?", cid)
			Topic[cid] = 1
		else
			npcHandler:say("Oh sorry, you don't have enough money.", cid)
			npcHandler:releaseFocus(cid)
		end
	elseif msgcontains(msg, "yes") and Topic[cid] == 1 then
		if not canPlayerWearOutfit(cid, 9, 0) then
			if doPlayerRemoveMoney(cid, cost) then
				doPlayerAddOutfit(cid, 9, 0)
				npcHandler:say("Enjoy your new outfit, please logout to save your character.", cid)
				Topic[cid] = 0
			else
				npcHandler:say("Oh sorry, you don't have enough money.", cid)
				Topic[cid] = 0
			end
		else
			npcHandler:say("Oh sorry, it seems you can wear this outfit already.", cid)
			Topic[cid] = 0
		end
	elseif msgcontains(msg, "no") then
		selfSay("Then leave!", cid)
		npcHandler:releaseFocus(cid)
	end
	
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
im using 7.92 Server (zorzin ot)
i got error Warning: [Npc Script: :Npc Script] Can not load script. data/npc/scripts/dany.lua

can you tell me how to install it I am very bad with the npc edition
 
let him learn it with by making a table more faster :p

Please stop following my posts and commenting on them, it's a little weird. :huh:

im using 7.92 Server (zorzin ot)
i got error Warning: [Npc Script: :Npc Script] Can not load script. data/npc/scripts/dany.lua

can you tell me how to install it I am very bad with the npc edition

That npc system is really outdated and I'm sorry to say, but I am unable to help in this situation.

Regards,
JDB.
 

Similar threads

Back
Top