• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua NPC MESSAGE_ONBUY

massuco

Brazilian, sorry for my bad english XD
Joined
Feb 17, 2013
Messages
199
Solutions
8
Reaction score
22
Location
Brasil
Im using OTHire 7.72.
I want to add one message that npc says when player buy something.

Any possibility of anything like this work? \/
npcHandler:setMessage(MESSAGE_ONBUY, "doPlayerSendTextMessage(cid, 19, "MY MESSAGE HERE")")

Normally the NPC says as yellow, in default. But I want that only the player that bought a item receive this message, like rl tibia as today (Bought 10x wand of inferno for 150000 gold coins.)
 
Im using OTHire 7.72.
I want to add one message that npc says when player buy something.

Any possibility of anything like this work? \/


Normally the NPC says as yellow, in default. But I want that only the player that bought a item receive this message, like rl tibia as today (Bought 10x wand of inferno for 150000 gold coins.)

Check your npc lib files, should be located in there.
A tip is to check the message if it says "You bought x" just serach for "you bought" and you should be able to find it.
Idk what OTHire is based on and would probbly be a nightmare trying to find the files you are using, so try to fix it yourself or upload your data/npcs/libs
 
I know that its on npchandler.lua
And I Can do this: npcHandler:setMessage(MESSAGE_ONBUY, "MY MESSAGE")

But I want to set one message that is don't displayed on default, like the npc conversation, I want one message like quests (You have found ...)
Understand me? I don't know if its possible, but I want to know if its. xD

Someone know if I can do this?
 
I would guess, inside the npc's lua file after onbuy add a doPlayerSendTextMessage.

For example:
LUA:
local function onBuy(cid, item, subType, amount, ignoreCap, inBackpacks)
     local player=Player(cid)
     player:sendTextMessage(type, text[, position, primaryValue = 0, primaryColor = TEXTCOLOR_NONE[, secondaryValue = 0, secondaryColor = TEXTCOLOR_NONE]])
etc...
 
Last edited:
Back
Top