方法
local players = game:GetService('Players'):GetChildren()
公式例:
Players = game:GetService("Players")
for i, player in pairs(Players:GetPlayers()) do
print(player.Name)
end
参考
https://developer.roblox.com/en-us/api-reference/function/Players/GetPlayers