Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make a GUI change for all Players on Server?

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

1 answer

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:GetChildrenand 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!

This discussion is preserved as it was. New answers, comments, and votes are closed.