Tagged Object

Description of objects available in the pets' code.

Tagged Object

All objects with tags that you can find with the pet code are table objects with a set of properties and methods. Some special objects, such as pet or me can have unique properties and methods.

Properties

name

type: string

The name of the entity. The name is not unique and several entities can have the same name.

id

type: number

The unique identifier of the entity in a world. id is unique ONLY in the one world.

health

Type: number

The current amount of health points.

if pet.health < 10 then
  pet:moveTo(me)
end

Methods

smt:hasTag(tag)

Checks if the object smt has the tag and return true or false

chevron-rightArgumentshashtag
  • tag - the tag that we check

    • type: string

    • optional: false

    • default: none

chevron-rightReturnshashtag
  • type: boolean

Last updated