I’'m trying to change the Text and TextColor of a TextLabel with a ClickDetector.
It’s probably a dumb question but I don’t use ClickDetectors
There are no errors. in the output.
local CP1 = workspace.CoolingStatusScreen.Part.SurfaceGui.CP1
function onClicked()
if CP1.Text == "ONLINE" then
CP1.Text = "OFFLINE"
CP1.TextColor3 = Color3.fromRGB(255, 0, 0)
else
if CP1.Text == "OFFLINE" then
CP1.Text = "ONLINE"
CP1.TextColor3 = Color3.fromRGB(0, 255, 0)
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)