util.timer.next_tick

Shared

Schedules a function to execute on the next engine tick


Syntax

local status = util.timer.next_tick(exec)

Parameters

TypeNameDescription
functionexecFunction to execute on the next engine tick

Returns

TypeNameDescription
boolstatustrue if the callback was successfully scheduled, false otherwise

Execute after resource starts
util.resource.start("my_resource")

util.timer.next_tick(function()
    core.engine.print("info", "Resource running?:", util.resource.is_running("my_resource"))
end)

On this page