Shared

Client.

Using Cosmoble

In order to begin using Cosmoble you will first need to fetch it, you can do this using require().

local Cosmoble = require(game:GetService("ReplicatedStorage").CosmobleShared

Getting a Cosmoble's Data

When you want to get the Cosmoble data via client, use the get and provide a Cosmoble name in order to get it, if data exists it will return a table containing it.

It is not recommended to use this function a lot, a cache is recommended.

Cosmoble.get("cosmobleName") -- Returns a table.

Connecting to a Cosmoble

When connecting to a Cosmoble via client, use the connectCosmoble function with the arguments below.

cosmobleName - string: The name of the Cosmoble table to connect to.

theConnection - string: A unique name for the connection.

function(key, value) - a callback function that will be called whenever a change is detected in your game data

Cosmoble:connectCosmoble("cosmobleName", "theConnection", function(key, value)
    print(key.." changed to "..value
end)

Disconnecting from a Cosmoble

When you are finished using a Cosmoble, you should disconnect from it using the disconnectCosmoble function with the arguments below, this will stop calling your connected function.

cosmobleName - string: The name of the Cosmoble table that you want to disconnect from.

connectionName - string: The unique name of the connection that you want to disconnect from.

Cosmoble:disconnectCosmoble("cosmobleName", "connectionName")

Last updated