📜  从角色 roblox 获取玩家 ID - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:31.333000             🧑  作者: Mango

代码示例1
local Players = game:GetService("Players")
local function getPlayerByUserId(userId)
    for _, player in pairs(Players:GetPlayers()) do
        if player.UserId == userId then
            return player
        end
    end
end