Informacje o wersji
Edukacja
Klasa silnika
MatchmakingService
Brak możliwości tworzenia
Usługa
Bez replikacji

*Ta zawartość została przetłumaczona przy użyciu narzędzi AI (w wersji beta) i może zawierać błędy. Aby wyświetlić tę stronę w języku angielskim, kliknij tutaj.


Podsumowanie
Członkowie odziedziczeni

Materiały referencyjne dotyczące interfejsów API
Metody
GetServerAttribute
Możliwości: Basic
MatchmakingService:GetServerAttribute(name:string):Tuple
Parametry
name:string
Zwroty

InitializeServerAttributesForStudio
Możliwości: Basic
MatchmakingService:InitializeServerAttributesForStudio(serverAttributes:Dictionary):Tuple
Parametry
serverAttributes:Dictionary
Zwroty

SetServerAttribute
Możliwości: Basic
MatchmakingService:SetServerAttribute(
name:string, value:Variant
Parametry
name:string
value:Variant
Zwroty
Przykłady kodu
Przykład usługi dopasowywania
local MatchmakingService = game:GetService("MatchmakingService")
local RunService = game:GetService("RunService")
if RunService:IsStudio() then
-- Konfiguruje początkowe atrybuty i schemat do testowania
MatchmakingService:InitializeServerAttributesForStudio({
Level = "Zaawansowany",
Elo = 123.456,
TrainingMode = true
})
end
-- Pobiera atrybut Level
local currentLevel, errorMessage = MatchmakingService:GetServerAttribute("Level")
if errorMessage then
warn(errorMessage)
else
print("Aktualny poziom: " .. currentLevel)
end
-- Aktualizuje wartość atrybutu Level na Zaawansowany
local success, errorMessage = MatchmakingService:SetServerAttribute("Level", "Zaawansowany")
if not success then
warn("Nie udało się zaktualizować atrybutu serwera [Level] na [Zaawansowany] z powodu błędu: " .. errorMessage)
else
print("Pomyślnie ustawiono [Level] na [Zaawansowany]")
end

©2026 Roblox Corporation. Nazwa Roblox, logo Roblox oraz hasło „Powering Imagination” należą do naszych zarejestrowanych i niezarejestrowanych znaków towarowych na terenie Stanów Zjednoczonych oraz w innych krajach.