เรียนรู้
Engine Class
MatchmakingService
ไม่สามารถสร้าง
บริการ
ไม่ซ้ำ

*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่


สรุป
วิธีการ
SetServerAttribute(name: string,value: Variant):Tuple
สมาชิกที่ได้รับทอด

เอกสารอ้างอิงเกี่ยวกับ API
วิธีการ
GetServerAttribute
ความสามารถ: Basic
MatchmakingService:GetServerAttribute(name:string):Tuple
พารามิเตอร์
name:string
ส่งค่ากลับ

InitializeServerAttributesForStudio
ความสามารถ: Basic
MatchmakingService:InitializeServerAttributesForStudio(serverAttributes:Dictionary):Tuple
พารามิเตอร์
serverAttributes:Dictionary
ส่งค่ากลับ

SetServerAttribute
ความสามารถ: Basic
MatchmakingService:SetServerAttribute(
name:string, value:Variant
พารามิเตอร์
name:string
value:Variant
ส่งค่ากลับ
ตัวอย่างโค้ด
ตัวอย่างบริการจับคู่
local MatchmakingService = game:GetService("MatchmakingService")
local RunService = game:GetService("RunService")
if RunService:IsStudio() then
-- ตั้งค่าคุณสมบัติและสคีมเริ่มต้นสำหรับการทดสอบ
MatchmakingService:InitializeServerAttributesForStudio({
Level = "ขั้นสูง",
Elo = 123.456,
TrainingMode = true
})
end
-- ดึงค่าคุณสมบัติ Level
local currentLevel, errorMessage = MatchmakingService:GetServerAttribute("Level")
if errorMessage then
warn(errorMessage)
else
print("ระดับปัจจุบัน: " .. currentLevel)
end
-- อัปเดตค่าคุณสมบัติ Level เป็นขั้นสูง
local success, errorMessage = MatchmakingService:SetServerAttribute("Level", "ขั้นสูง")
if not success then
warn("ไม่สามารถอัปเดตคุณสมบัติเซิร์ฟเวอร์ [Level] เป็น [ขั้นสูง] ได้เนื่องจากข้อผิดพลาด: " .. errorMessage)
else
print("ตั้งค่า [Level] เป็น [ขั้นสูง] สำเร็จ")
end

©2026 Roblox Corporation. Roblox, โลโก้ Roblox และ Powering Imagination เป็นส่วนหนึ่งของเครื่องหมายการค้าที่จดทะเบียน และไม่ได้จดทะเบียนของเราในสหรัฐฯ และประเทศอื่นๆ