Engine Class
UserService
*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่
สรุป
วิธีการ
GetUserInfosByUserIdsAsync(userIds: {any}):{any} |
GetUserFromGlobalUserIdAsync(userId: number):User |
เอกสารอ้างอิงเกี่ยวกับ API
วิธีการ
GetUserInfosByUserIdsAsync
พารามิเตอร์
ส่งค่ากลับ
ตัวอย่างโค้ด
ตัวอย่าง UserService:GetUserInfosByUserIdsAsync
local UserService = game:GetService("UserService")
local success, result = pcall(function()
return UserService:GetUserInfosByUserIdsAsync({ 156, 1, 735878936 })
end)
if success then
for _, userInfo in ipairs(result) do
print("รหัส:", userInfo.Id)
print("ชื่อผู้ใช้:", userInfo.Username)
print("ชื่อแสดงผล:", userInfo.DisplayName)
end
else
-- เกิดข้อผิดพลาด
end