Part = script.Parent Part1 = game.Workspace.ColorChangingPart ILikeFood = true if ILikeFood == true then Part.BrickColor = BrickColor.Random() end if ILikeFood == true then script.Parent.ClickDetector.MouseClick:Connect(function(fdgdgd) Part1.BrickColor = BrickColor.Random() end) end
What I am trying to achieve: I want the 'Part' to change to a random color as soon as the game starts forever. I also want 'Part1' to change to a random color forever when 'Part' is clicked once.
Errors: None
What happens: 'Part' does not change color at all and 'Part1' only changes color once.
Maybe you could try this out:
Part = script.Parent Part1 = workspace.ColorChangingPart ILikeFood = true script.Parent.ClickDetector.MouseClick:Connect(function() if ILikeFood == true then Part1.Color = Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255)) end end)
Tell me if Part1 changes colors. If it doesn't, I have a few questions:
Does it have any errors in the output?
Have you ever tried using the Lua Debugger to find what the issue is out?
Is this a server script, and is it actually located in Part?