Need Help with a Code

1. **What do you want to achieve?** Keep it simple and clear!

2. **What is the issue?** Include screenshots / videos if possible!

3. **What solutions have you tried so far?** Did you look for solutions on the Developer Hub?

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it's easier for people to help you!

```lua
-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.```


I need help. With a code.

while true do 
local part = game.Part
            part.Color = Color.new(math.random(9), 8 math.random(83.3, 2)
}

why wont this Code work?
Roblox is broken omg

Try this code:

while task.wait() do
local a = math.random(1,255)
local b = math.random(1,255)
local c = math.random(1,255)
local part = game.Workspace:WaitForChild("Part")
part.Color = Color3.new(b,a,c)
end

tysm it orked@!!! :heart: :heart: :heart: :heart: :heart: :heart:

Declare the part’s reference outside of the loop, also consider using an event loop instead.

local Game
local Workspace = workspace
local RunService = Game:GetService("RunService")
local Part = Workspace:WaitForChild("Part")

local function OnRenderStep()
	Part.BrickColor = BrickColor.Random()
end

RunService.RenderStepped:Connect(OnRenderStep)
2 Likes

Oh yeah. Thanks for the information…