I want to make it so everyone's screen is changed when someone clicks a button. Any idea how?
✓ ANSWER ACCEPTED
How to change gui on everyone's screen?
1 answer
✓ Accepted answer
Just iterate over the players. If the button is on a GUI then you will need to run the code on server since a client doesn't have knowledge of other players GUIs. You could use RemoteFunctions
Code on client:
script.Parent.TextButton.MouseButton1Click:connect(function()
game.ReplicatedStorage.RemoteFunction:InvokeServer()
end)
Code on server:
game.ReplicatedStorage.RemoteFunction.OnServerInvoke = function(player, arg)
for k, v in next, game.Players:GetPlayers() do
v.PlayerGui.ScreenGui.Frame.BackgroundColor3 = BrickColor.Random().Color
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
