Najova

DocsBuilt-in functions

Things and events

Things come from the game engine or an extension: a door, a player, a Discord message. These functions read them, change them and listen to them.

$call

$call[thing.Method;values...]

Calls a method of a thing, like $call[door.Destroy] or $call[remote.Send;hello].

call.najanot run here
$call[door.Open]
$call[remote.Send;hello]
Needs a thing from a game or an extension.

$getProperty

$getProperty[thing;member]

A member of a thing, by its name: $getProperty[$get[door];Colour].

getProperty.najanot run here
$let[member;Colour]
$print[$getProperty[$get[door];$get[member]]]
Use it when the member's name is in a value. Needs a thing from a game or an extension.

$setProperty

$setProperty[thing;member;value]

Changes a member of a thing, by its name.

setProperty.najanot run here
$setProperty[$get[door];Colour;$colour[red]]
Needs a thing from a game or an extension.

$onBlock

$on[thing.Event;value names...]

Runs what follows each time the event happens, like $on[door.Touched;other].

on.najanot run here
$on[door.Touched;other]
  $print[$get[other.Name] touched the door]
$endon
Needs a thing from a game or an extension.

$vector

$vector[x;y;z]

A position, size or direction.

vector.naja
$let[spot;$vector[1;2;3]]
$print[$get[spot]]
najova run vector.naja
1, 2, 3

$colour

$colour[name] or $colour[red;green;blue]

A colour by its name (red, blue ...) or by red, green and blue from 0 to 255.

colour.naja
$print[$colour[red]]
$print[$colour[255;128;0]]
najova run colour.naja
#ff0000
#ff8000

$color

$color[name] or $color[red;green;blue]

The same as $colour.

color.naja
$print[$color[blue]]
najova run color.naja
#0000ff

$context

$context

Inside an extension's functions: the context of the extension block that is running (the command, the message ...), or nil.

context.najanot run here
$function[block_greet]
  $print[Running inside: $get[$context]]
$endfunction
Only for extension makers, inside the functions behind an extension block.