nanos world API Reference Unofficial documentation
Static function Shared Fast

Timer.Bind

Binds a Timer to any Actor. The timer will be automatically cleared when the Actor is destroyed

Syntax

Lua
Timer.Bind(timer_id, actor)

Parameters

Name Type Default Description
timer_id integer The Timer ID
actor Actor Actor to be bound

Examples

Binding a Timer to an Entity
local character = Character(Vector(), Rotator(), "nanos-world::SK_Male"),,local my_timer = Timer.SetTimeout(function(_character),    -- Do something with _character,    -- Ex: Destroy the character after 10 seconds,    _character:Destroy(),end, 10000, character),,-- Binds the Timer to the Character,-- This will ensure it will never trigger if the character is destroyed before it,-- With this you don't need to validate if the '_character' parameter is valid,Timer.Bind(my_timer, character)