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

Lua Is it possible to check if NPC has a trade option on player events?

  • Thread starter Thread starter Evil Puncker
  • Start date Start date
E

Evil Puncker

Guest
Hello, I'm using latest 1.3 TFS, and wanted to add this modification to interact with npc on look, but I want it to be performed only on NPCs that have sellable items, is there a way to check it on players.lua? or the only way to go is checking a table with npc names? thanks in advance
 
Solution
If you have a specific speech bubble id for only NPCs that can trade, you can use that speech bubble to identify if the player is able to trade with the NPC by utilizing npc:getSpeechBubble(). Otherwise, just go with the latter and create a table with npc names->(true/false) to identify tradable npcs.
If you have a specific speech bubble id for only NPCs that can trade, you can use that speech bubble to identify if the player is able to trade with the NPC by utilizing npc:getSpeechBubble(). Otherwise, just go with the latter and create a table with npc names->(true/false) to identify tradable npcs.
 
Solution
Back
Top