Aprenda
Classe do mecanismo
MatchmakingService
Não criável
Serviço
Não replicado

*Este conteúdo é traduzido por IA (Beta) e pode conter erros. Para ver a página em inglês, clique aqui.


Resumo
Membros herdados

Referência API
Métodos
GetServerAttribute
Recursos: Basic
MatchmakingService:GetServerAttribute(name:string):Tuple
Parâmetros
name:string
Devolução

InitializeServerAttributesForStudio
Recursos: Basic
MatchmakingService:InitializeServerAttributesForStudio(serverAttributes:Dictionary):Tuple
Parâmetros
serverAttributes:Dictionary
Devolução

SetServerAttribute
Recursos: Basic
MatchmakingService:SetServerAttribute(
name:string, value:Variant
Parâmetros
name:string
value:Variant
Devolução
Amostras de código
Exemplo do MatchmakingService
local MatchmakingService = game:GetService("MatchmakingService")
local RunService = game:GetService("RunService")
if RunService:IsStudio() then
-- Configura os atributos iniciais e o esquema para teste
MatchmakingService:InitializeServerAttributesForStudio({
Level = "Avançado",
Elo = 123.456,
TrainingMode = true
})
end
-- Recupera o atributo Level
local currentLevel, errorMessage = MatchmakingService:GetServerAttribute("Level")
if errorMessage then
warn(errorMessage)
else
print("Nível atual: " .. currentLevel)
end
-- Atualiza o valor do atributo Level para Avançado
local success, errorMessage = MatchmakingService:SetServerAttribute("Level", "Avançado")
if not success then
warn("Falha ao atualizar o atributo do servidor [Level] para [Avançado] devido a erro: " .. errorMessage)
else
print("Atributo [Level] definido com sucesso para [Avançado]")
end

©2026 Roblox Corporation, Roblox, o logotipo Roblox e Powering Imagination estão entre nossas marcas registradas e não registradas nos EUA e em outros países.