Impara
Classe motore
MatchmakingService
Non costruibile
Assistenza
Non Replicato

*Questo contenuto è tradotto usando AI (Beta) e potrebbe contenere errori. Per visualizzare questa pagina in inglese, clicca qui.


Sommario
Membri ereditati

Riferimento API
Metodi
GetServerAttribute
Capacità: Basic
MatchmakingService:GetServerAttribute(name:string):Tuple
Parametri
name:string
Restituzioni

InitializeServerAttributesForStudio
Capacità: Basic
MatchmakingService:InitializeServerAttributesForStudio(serverAttributes:Dictionary):Tuple
Parametri
serverAttributes:Dictionary
Restituzioni

SetServerAttribute
Capacità: Basic
MatchmakingService:SetServerAttribute(
name:string, value:Variant
Parametri
name:string
value:Variant
Restituzioni
Campioni di codice
Esempio di MatchmakingService
local MatchmakingService = game:GetService("MatchmakingService")
local RunService = game:GetService("RunService")
if RunService:IsStudio() then
-- Imposta gli attributi e lo schema iniziali per il test
MatchmakingService:InitializeServerAttributesForStudio({
Level = "Avanzato",
Elo = 123.456,
TrainingMode = true
})
end
-- Recupera l'attributo Livello
local currentLevel, errorMessage = MatchmakingService:GetServerAttribute("Level")
if errorMessage then
warn(errorMessage)
else
print("Livello attuale: " .. currentLevel)
end
-- Aggiorna il valore dell'attributo Livello a Avanzato
local success, errorMessage = MatchmakingService:SetServerAttribute("Level", "Avanzato")
if not success then
warn("Impossibile aggiornare l'attributo del server [Level] a [Avanzato] a causa dell'errore: " .. errorMessage)
else
print("Impostato con successo [Level] su [Avanzato]")
end

© 2026 Roblox Corporation. Roblox, il logo Roblox e Powering Imagination sono tra i nostri marchi registrati e non registrati negli Stati Uniti. e altri paesi.