Coding probelm while making a part change colour radomly

Hi, I am reviewing the basics since I did not code since a long time and the codes works but it only changes the block’s colour once not muplite times.

It only changes once because the function only runs once.

while loop in your code is pretty unnecessary, for the anchor code. For the BrickColor part, I’m pretty sure your script is running past its allocated time because there’s no delay inside the loop

This should work:

local DELAY = 1 -- In seconds

local function changeColor()
    local part = Instance.new("Part")
    part.Name = "The_changeingblock"
    part.Anchored = false
    part.Parent = workspace

    while true do
        wait(DELAY)
        part.BrickColor = BrickColor.Random()
    end
end

changeColor()

Why would be detele is there a TOS about that?

I deleted because I made a few mistakes with the backsticks and if I had left it there it would be very confusing. Also this is my first post

Oh ok. Thanks for the help Mah!