RobloxAPIConfigs

Configs

server

client

This API is used to retrieve the values of Gamebeast configs.

local Gamebeast = require(game:GetService("ReplicatedStorage"):WaitForChild("Gamebeast"))
local GamebeastConfigs = Gamebeast:GetService("Configs")

:Get(path)

→ {[string] : any} | any

This function is used to retrieve the value of a specific config. It can accept either a single string or a list of strings as the path parameter. The :Get method will yeild until the configs are loaded from Gamebeast.

path

string | {string}

The configuration path to retrieve. You can provide either a single string or a list of strings.

Usage

-- string
local SunPosition = GamebeastConfigs:Get("SunPosition")
 
-- Path (array of strings)
local SunPosition = GamebeastConfigs:Get({"SunPosition"})
local Health = GamebeastConfigs:Get({"NPCs", "Spider", "Health"})

:OnChanged(path, callback)

→ RBXScriptSignal

This function is used to retrieve the value of a specific config. It can accept either a single string or a list of strings as the path parameter.

path

string | {string}

The configuration path to retrieve. You can provide either a single string or a list of strings.

callback

(newValue : any, oldValue : any) -> ()

Callback function fired when the config on the provided path changes.

Usage

-- string
GamebeastConfigs:OnChanged("SunPosition", function(newValue, oldValue)
    print("New config", newValue)
end)
 
-- Path (array of strings)
local ChangedConnection = GamebeastConfigs:OnChanged({"Lighting", "Atmosphere"}, function(newValue, oldValue)
    print("New config", newValue)
end)

:IsReady()

→ boolean

Returns a boolean indicating whether the config are loaded and ready to be used.

Usage

if GamebeastConfigs:IsReady() then
    print("Configs are ready!")
end

:OnReady(callback)

→ RBXScriptSignal

This method fires a callback once the configs are loaded from Gamebeast.

callback

(configs : any) -> ()

Callback function fired when the configs are ready.

Usage

GamebeastConfigs:OnReady(function(configs)
    print("Configs are ready!", configs)
end)