On Network Variable Change (Event) — skNetwork

Addon: skNetwork · Category: Event · Since: 0.2.0

Syntax

[on] network variable change [of %-string%]

Description

Fires on every server the moment a network variable changes, including the one that wrote it. Give it a name to listen to one branch instead of every write on the network. A `*` is a wildcard, the same as `/sknetproxy dump`. That name is the stored key, not a variable name, so a `%player%` written inside it is never filled in. Match the branch with `*` and read `the changed variable` to find out who it was. Nothing fires while a snapshot is arriving, so a server joining does not replay the whole map as changes. Guide: https://github.com/ahmadmsaleem/skNetwork/wiki/Sync-and-Events

Examples

on network variable change of "inbox::*":
	set {_who} to the last element of (the changed variable split at "::")
	set {_player} to {_who} parsed as offline player
	if {_player} is online:
		send the new value to {_player}

View source