01 | Part = script.Parent |
02 | Part 1 = game.Workspace.ColorChangingPart |
03 | ILikeFood = true |
04 |
05 | if ILikeFood = = true then |
06 | Part.BrickColor = BrickColor.Random() |
07 | end |
08 |
09 | if ILikeFood = = true then |
10 | script.Parent.ClickDetector.MouseClick:Connect( function (fdgdgd) |
11 | Part 1. BrickColor = BrickColor.Random() |
12 | end ) |
13 | 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:
1 | Part = script.Parent |
2 | Part 1 = workspace.ColorChangingPart |
3 | ILikeFood = true |
4 |
5 | script.Parent.ClickDetector.MouseClick:Connect( function () |
6 | if ILikeFood = = true then |
7 | Part 1. Color = Color 3. fromRGB(math.random( 0 , 255 ),math.random( 0 , 255 ),math.random( 0 , 255 )) |
8 | end |
9 | 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?