function Amarelo() for i,v in pairs(game.Players:GetPlayers()) do v.PlayerGui.Gui1.Frame.cor.BackgroundColor3 = Color3.new(255, 255, 0) v.PlayerGui.Gui1.Frame.TextLabel.Text = "Ocorreu alguma coisa, sem ultrapassagens, diminua sua velocidade!" end end script.Parent.MouseButton1Click:connect(Amarelo)
In Output shows this:
PlayerGui is not a valid member of Player
PORTUGUEASE
Olá, Bruno_GamerX!
Nos meus testes, game.Players:GetPlayers()
não funcionou, então eu troquei para game.Players:GetChildren
o que resolveu meu probrema, eu só tive que mudar poucas coisas no script =D
function Amarelo() for i,v in pairs(game.Players:GetChildren()) do game.Players[v].PlayerGui.Gui1.Frame.cor.BackgroundColor3 = Color3.new(255, 255, 0) game.Players[v].PlayerGui.Gui1.Frame.TextLabel.Text = "Ocorreu alguma coisa, sem ultrapassagens, diminua sua velocidade!" end end script.Parent.MouseButton1Click:connect(Amarelo)
Boa Sorte com seus Jogos!
ENGLISH
Hello, Bruno_GamerX!
On my tests, game.Players:GetPlayers()
didn't worked, so I changed it to game.Players:GetChildren
and that solved my problem, I just had to change somethings on your script =D
function Amarelo() for i,v in pairs(game.Players:GetChildren()) do game.Players[v].PlayerGui.Gui1.Frame.cor.BackgroundColor3 = Color3.new(255, 255, 0) game.Players[v].PlayerGui.Gui1.Frame.TextLabel.Text = "Ocorreu alguma coisa, sem ultrapassagens, diminua sua velocidade!" end end script.Parent.MouseButton1Click:connect(Amarelo)
Good Luck with your games!