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.0.0   See changelog


No changelog available for this version.

  • Like 2

User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.



   1 of 1 member found this review helpful 1 / 1 member

its js

Share this review

Link to review



Share this review

Link to review


woooooooawwww reeeeeeeally epic.........for an JS


Share this review

Link to review