self:is_type

Client

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 an audio-2d instance
local entity = core.audio_2d.create("sounds/ambient.ogg")

core.engine.print("info", entity:is_type("audio_2d")) -- true
core.engine.print("info", entity:is_type("audio_3d")) -- false

On this page