self:is_type

Shared

Checks whether the instance belongs to the specified type


Syntax

local result = self:is_type(
    name
)

Parameters

TypeNameDescription
stringnameType to check against

Returns

TypeNameDescription
boolresulttrue if the instance matches the given type, false otherwise

Examples

Check the type of a timer instance
local entity = util.timer.create(function(count)
    core.engine.print("info", "Counter:", count)
end, 1000, 1)

core.engine.print("info", entity:is_type("timer")) -- true
core.engine.print("info", entity:is_type("texture")) -- false

On this page