Shared World Data 1.1.0

   (3 reviews)
Sign in to follow this  

About This File

If you ever used GTA Network's setWorldSyncedData/SetWorldSharedData, you probably have an idea of what this resource does. If you haven't used those, this resource lets you set variables that will be synced to all clients.



  • Put the files you downloaded in their respective places
  • Add require('worlddata') to client_packages/index.js, preferably as the first module you require
  • All done



There isn't much to it, you can do one of these to set shared data: = myValue;["myDataKey"] = myValue;

you can do one of these to get shared data:["myDataKey"]

and you can do one of these to remove shared data:


(1.1) now you can do this to set multiple shared data at once, thanks to @kemperrr:; // see examples

You can use setting/deleting code on clientside as well but it won't affect the data on serverside. If anything your changes will get overriden when myDataKey is updated, so there's no point in using setting/deleting code on clientside.


Events (Clientside)

// worldDataReady is called when the player receives all shared data."worldDataReady", () => {
    // Example, print all data keys to chat`World data ready! ${Object.keys(",")}`);

// worldDataChanged is called when shared data changes."worldDataChanged", (key, oldValue, newValue) => {
    // Example, show which data key changed with its old and new value`World data changed: ${key} | old: ${oldValue} | new: ${newValue}`);

// worldDataRemoved is called when shared data is removed."worldDataRemoved", (key) => {
    // Example, show which data key got removed`World data removed: ${key}`);


Example (Serverside)

let gameSeconds = 0;

// Increase gameSeconds every second and update the world data every 5 seconds, for no reason...
setInterval(() => {

    if (gameSeconds % 5 === 0) {
        // You can use["exampleVariable"] as well = gameSeconds;
        console.log(`exampleVariable is now ${}`);
}, 1000);
// Will update serverUpdated, serverName, serverWebsite shared data.{
    "serverName": "RAGE Multiplayer Server #545"
    "serverWebsite": ""

Source code is available on GitHub in case you don't want to download:

What's New in Version 1.1.0   See changelog


This feature was contributed by @kemperrr.

- Added which provides a nice & efficent way to update multiple shared data.

// Example: Will update serverUpdated, serverName, serverWebsite shared data.{
    "serverName": "RAGE Multiplayer Server #545"
    "serverWebsite": ""


  • Like 2

User Feedback

Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now