✓ Accepted answer
You are attempting to assign TextColor3 to 85.
Remember that in multiple assignment, additional results are silently discarded.
If you execute these, the respective outputs will be 1 nil and 1.
local v1, v2 = 1;
print(v1, v2);
local v1 = 1, 2;
print(v1);
One of the Color3 constructors is fromRGB. It takes numbers as args ranging from 0-255.
Also, you were using script.Parent.Parent.Parent.Status.SurfaceGui.TextLabel a lot to access its properties, so why not have a variable contain a reference so it so you do not repeat yourself?
local clickDetector = script.Parent;
local part = clickDetector.Parent;
local textLabel = part.Parent.Status.SurfaceGui.TextLabel;
script.Parent.MouseClick:Connect(function()
part.BrickColor = BrickColor.Green();
textLabel.Text = "Status Online";
textLabel.TextColor3 = Color3.fromRGB(85, 255, 0);
end);
Even then you shouldn't have so many .Parents. Remember to keep your code dry.
Don't
Repeat
Yourself
1 comment
Color3.fromRGB(85, 255, 0). You made a rookie mistake.