Skip to main content

SyncVar.OnVariableChange

"Read-Only"

This property is Read-Only

NameType
OnVariableChangeEventHandler

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 new value of 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.OnVariableChange.Add(CallBack);

Description

Event handler that invokes when the value of the Synchronized variable changes by any clients.