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

Check if specific item is in backpack

Newone0

Member
Joined
Nov 22, 2021
Messages
59
Reaction score
7
Wants to check if the player has an item in their inventory. The problem arises when the player, for example, throws an item and it disappears and then the "target: getTopParent ()" function is performed on that item, this is a crash.
Do you have any idea how to check if the player still has this item?
 
I'm not sure I understand what you need.. Would
Lua:
player:getItemCount(11400)
work
or maybe
Code:
targetItem:getTopParent() == player
 
I'm not sure I understand what you need.. Would
Lua:
player:getItemCount(11400)
work
or maybe
Code:
targetItem:getTopParent() == player
The point is that the function is trying to perform an operation on an object that does not exist. Is there any possibility to check if a given item exists?
 
Back
Top