Skip to main content

IsAvatarItem

Checks if an Item is a child of the LocalAvatar

Parameters

Parameter NameParameter TypeParameter Description
itemitemThe Item to check

The following example is provided an Item and checks if it is a child of the LocalAvatar

JavaScript

// Assume item has been declared and is an Item
if(instance.GetHandler("Players").LocalPlayers.Avatar.IsAvatarItem(item))
{
print(Item.Name + " is a child of the Avatar!")
return
}
print(Item.Name + " is not a child of the Avatar!")

Lua

-- Assume item has been declared and is an Item
if instance.GetHandler("Players").LocalPlayers.Avatar.IsAvatarItem(item) then
print(Item.Name.." is a child of the Avatar!")
return
end
print(Item.Name.." is not a child of the Avatar!")