From RAGE Multiplayer Wiki
Jump to navigation Jump to search

This Function is used to alert client-side with entity's data change for a specified variable

Client-Side Function

C.png C# Js.png JavaScript

C# Syntax
C.png name, OnEntityDataChangeDelegate handler);


  • name
  • handler

JavaScript Syntax
Jslogo.png, handlerFunction);


  • key: String - Shared data key's name.
  • handlerFunction: Handler function with parameters:
    • entity: Entity - The entity that had the data change.
    • value: Any - The new value of the data key.
    • oldValue: Any - The old value of the data key.


    Handles testVar change.
    Do " = 1234;" on server-side to trigger this.
*/"testVar", (entity, value, oldValue) => {`testVar changed to ${value} on entity ${entity.handle}.`);


This example sets nickname for player and triggers players' clientside data handler

Server-Side'setNick', (player, nickname) => {
  player.setVariable('oldNick',; = nickname;
  player.setVariable('newNick', nickname);

Client-Side'newNick', function (entity, value, oldValue) {
  if (entity.type === 'player')`${player.getVariable('oldNick')} has changed nickname to ${value}`)

See Also