MatchmakingService
Show Deprecated
MatchmakingService is responsible for managing custom matchmaking attributes. Use it to read and write matchmaking data.
Summary
Methods
Retrieves the value of a specific server attribute.
Initiates the server attribute schema and its values to test in Studio.
Assigns a value to a specific server attribute.
Properties
Methods
SetServerAttribute
Parameters
value: Variant
Returns
Code Samples
MarketplaceService sample
local MatchmakingService = game::GetService("MatchmakingService")
local RunService = game:GetService("RunService")
if RunService:IsStudio() then
-- Sets up initial attributes and schema for testing
MatchmakingService:InitializeServerAttributesForStudio(
{
Level = "Advanced",
Elo = 123.456,
TrainingMode = true
})
end
-- Retrieves the Level attribute
local currentLevel, error = MatchmakingService:GetServerAttribute("Level")
if error then
print(error)
else
print("Current level: " .. currentLevel)
end
-- Updates the Level attribute value to Advanced
local success, error = MatchmakingService:SetServerAttribute("Level", "Advanced")
if not success then
print("Failed to update server attribute [Level] to [Advanced] due to error: " .. error)
else
print("Successfully set [Level] to [Advanced]")
end