• 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] Special Selling Npc

Exedion

Active Member
Joined
Jun 11, 2007
Messages
629
Reaction score
30
Dont't know if this is possible, but i need the example for a npc to get the money directly from the bank balance of player, can be do?
 
Code:
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

function creatureSayCallback(cid, type, msg)

	if(not npcHandler:isFocused(cid)) then
		return false
	elseif msgcontains(msg, "balance") then
		local balance = getPlayerBalance(cid)
		npcHandler:say(balance >= 10000000 and "I think you must be one of the richest inhabitants of Tibia! Your account balance is " .. balance .. " gold." or balance >= 1000000 and "Wow, you've reached the magic number of one million gp! Your account balance is " .. balance .. " gold." or balance >= 100000 and "You certainly have made a pretty penny. Your account balance is " .. balance .. " gold." or "Your account balance is " .. balance .. " gold.", cid)
	end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Not sure what you meant with 'get'
 
well thanks for you time, i will make click shop with actions :) and in the future, will be usefull this option, it gives more functions to the bank system
 
Back
Top