So I'm trying to get all the players in the games name, but with what I have it only prints "Players." How do I change my script so it prints every players name?

-The local script is in a text button-

local on = false
local Players = game:GetService("Players")
local plr = Players:GetChildren(Players)
script.Parent.Activated:Connect(function()
	if on == false then
		print(Players.Name)
		
		wait(3)
		on = true
	end
	
	if on == true then
		wait(3)
		on = false
	end
end)

4 comments

0

It won let me answer the question.

0

My discord is Hex#5186

0

local plr = game.Players:GetPlayers() for i,v in pairs (plr) do print(plr.Name) end)

0

That answer is probably gonna help me in the future