Skip to main content

SyncVar.OnVariableSet

NameType
OnVariableSetEventHandler

Event callback function requirement

info

This property is an event. It means that you need to add a listener function to it. Here how that function needs to look like.

function(any value);

Parameters
NameTypeDescription
valueanyThe value set to the variable.

Usage

--- @type 
local syncvar;

--- callback function called when event triggers
--- @param any any
local function CallBack(any)
-- code to handle event call back
end


-- Regsiter callback function
syncvar.OnVariableSet.Add(CallBack);

Description

Event handler called when the Sync variable set (even if still the same values set).