How would I change a gui's color to something in a server script?

  1. What do you want to achieve? I want to change my gui’s color to a randomly chosen brickcolor from a table for my minigame.

  2. What is the issue? Playergui won’t work because it’s server sided

  3. What solutions have you tried so far? Everything

Script:

function findBricks(ColorParts)
	local ChosenColor = BrickColors[math.random(1, #BrickColors)]
	for k,v in pairs(ColorParts:GetDescendants()) do
		if v:IsA("BasePart") and v.BrickColor ~= BrickColor.new(ChosenColor) then
			v.Transparency = 1
			v.CanCollide = false
			print(ChosenColor)
		end
	end
end

Have you tried using RemoteEvents? The roblox article includes an example for what you need, which is a server firing an event to all clients.

2 Likes

I would make a bunch of brickColor values inside the GUI inside a folder and make buttons in a settings somewhere to change the GUIs color.

Maybe a boolValue should control the GUI colors. ( like a boolValue inside the GUI being turned true or false depending on what the color should be )

Here is an image of what I mean

image

Also, I think you can only use Color3Values for coloring GUI, but I might be wrong.
Anyways, hope this helped.

1 Like

But since I am picking a random value from a table how would I say like “if the value of the outcome of the table is really red, really red = true”?

Just found this with a similar issue. Help with color Change gui - #33 by Exeplex

You could read everything there, but I’d just read the end bit. ( it has 2 solutions )

1 Like