How do I make my ui in color game the randomly picked color?

  1. What do you want to achieve? So I want to make the UI the color of the color chosen randomly in my game

  2. What is the issue? I don’t know how to chance the ui’s color from a server script

  3. What solutions have you tried so far? I currently have the color held in a string value as a brick color and I need to make a script that makes the ui color that string value but as a hue so not sure

MAIN SCRIPT


local ColorParts = game.Workspace.ColorParts

local BrickColors = {"Really red","Deep orange","New Yeller","Dark blue","Hot pink","Reddish Brown","Lime green","Magenta"}

local lobbyLocation = game.Workspace.Lobby.Lobby2.Position + Vector3.new(0,3,0)
local gameLocation = game.Workspace.Lobby.Game.Position + Vector3.new(0,3,0)

local IntermissionTime = 3
local GameTime = 10


local function playGame()

end

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

function beforeGame()
	for _, v in pairs(ColorParts:GetDescendants()) do
		if v:IsA("BasePart") then
			if v.Name == "Part" then
				v.Transparency = 0
				v.CanCollide = true
				local ChosenColor = BrickColors[math.random(1, #BrickColors)]
				v.BrickColor = BrickColor.new(ChosenColor)
				
			end
		end
	end
end

function playIntermission()
	for _, v in pairs(ColorParts:GetDescendants()) do
		if v:IsA("BasePart") then
			if v.Name == "Part" then
				v.Transparency = 1
				v.CanCollide = false
			end
		end
	end
end

function resetPlayers()
	print("Players have been reset!")
	for _, plr in pairs(game.Players:GetChildren()) do

		plr.Character.HumanoidRootPart.CFrame = CFrame.new(lobbyLocation)
	end 
end

function teleportPlayers()
	print("Players were teleported!")
	for _, plr in pairs(game.Players:GetChildren()) do

		plr.Character.HumanoidRootPart.CFrame = CFrame.new(gameLocation)
	end 
end


wait(3)
while true do
	resetPlayers()
	playIntermission()
	wait(IntermissionTime)
	teleportPlayers()
	beforeGame()
	wait(4)
	findBricks(ColorParts)
	wait(GameTime)
	playGame()
end

You can’t do it from a server script, do it on a localscript

How would I DO THAT? very confused right now

well, you can use remote events