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

TFS 1.X+ How to make NPC detect an item?

Sleet

Member
Joined
Sep 3, 2016
Messages
107
Solutions
2
Reaction score
7
I want to make a npc detect a item and not allow the player to do a action, but I don't know how to do it...

Here's what I did so far:

Lua:
... if getPlayerItemById(cid, 0000) == true then
            npcHandler:say("What? You want me to do that? No way!", cid)
        else ...

UPDATE:

I read some codes and learned how to do it:

Lua:
...if getPlayerItemById(cid, true, 0000).itemid == 0000 then
            npcHandler:say("What? You want me to do that? No way!", cid)
        else...

Here it is for anyone who needs it.
 
Last edited:
If I were you, i would use getItemCount.

Code:
if player:getItemCount(itemId) == amount then
 
Solution
Back
Top