1 | local players = game.Players:GetChildren() |
2 | for i,v in pairs (players) do |
3 | v.PlayerGui.ScreenGui.Frame.Visible = true |
4 | end |
is this how for i,v in pairs(players)do work?
Incase a user doesn't have the gui and the script breaks, use this:
1 | local players = game.Players:GetChildren() |
2 | for i,v in pairs (players) do |
3 | if v and v:FindFirstChild( "PlayerGui" ) ~ = nil and v.PlayerGui:FindFirstChild( "ScreenGui" ) ~ = nil then |
4 | v.PlayerGui.ScreenGui.Frame.Visible = true |
5 | end |
6 | end |
Do you even know what for i, v are actually? and what GetChildren() does?