I need to access every players character and PlayerGui. How would I do this? This is the script I have been working on but it doesn't work:
local numPlayers = #game:GetService("Players"):GetPlayers();
if numPlayers < 2 then
for i, v in pairs (game.Players:GetPlayers()) do
v.PlayerGui.ScreenGui.Frame.TextLabel = "Not Enough"
end
elseif numPlayers > 1 then
for i, v in pairs (game.Players:GetPlayers()) do
v.PlayerGui.ScreenGui.Frame.TextLabel = "Enough"
end
end

1 comment
Currently, your script only checks if there are enough players once, if you want the script to continually check use a loop. To access a Player's Gui, you have correct. To access a Player's Character just use v.Character and mess around with their humanoid or torso.