• 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 [solved] NPC buying problem

jakub742

Member
Joined
May 1, 2010
Messages
144
Solutions
2
Reaction score
20
Location
Slovakia
Hello. I created a lua script for buying weapons and ammunition. Problem is that, if player ask for crossbow he gets a bow, because word crossbow contains a 'bow'. Is there any way to check only for full (exact) word and not just a part of it ?

Here is my code:
Code:
shopModule:addBuyableItem({'bow'}, 2456, 400, 1, 'Bow')
shopModule:addBuyableItem({'crossbow'}, 2455, 400, 1, 'Crossbow')

Full script: http://pastebin.com/3d8UbDb4
 
Code:
shopModule:addBuyableItem({'crossbow'}, 2455, 400, 1, 'Crossbow')
shopModule:addBuyableItem({'bow'}, 2456, 400, 1, 'Bow')

You were right. In this order it works. Thanks
 
Back
Top