Make sure to change your script.Parent.Text == 0and script.Parent.Text == 1 to surround quotation marks around the 0 and 1, that is why you’re not getting any results.
Not related to your question but you can also assign the script.Parent to a variable so you don’t have to write script.Parent everytime like this:
local object = script.Parent --You can change the "object" variable to anything else you want. I just named it object for this example.
By looking at your code I think you’re trying to run your code when the Text property changes which in this case you can use :GetPropertyChangedSignal() instead of .Changed event like this so function only runs when text changes like this:
local object = script.Parent
object:GetPropertyChangedSignal("Text"):Connect(function()
if object.Text == "0" then
object.Parent.ImageColor3 = object.Parent.ImageColor3:lerp(Color3.fromRGB(255,255,255),0.5)
object.TextColor3 = object.TextColor3:Lerp(Color3.fromRGB(255,255,255),0.5)
object.TextStrokeColor3 = object.TextStrokeColor3:Lerp(Color3.fromRGB(102, 102, 102),0.5)
elseif object.Text == "1" then
object.Parent.ImageColor3 = object.Parent.ImageColor3:Lerp(Color3.fromRGB(188, 253, 185),0.5)
object.TextColor3 = object.TextColor3:Lerp(Color3.fromRGB(188, 253, 185),0.5)
object.TextStrokeColor3 = object.TextStrokeColor3:Lerp(Color3.fromRGB(83, 110, 82),0.5)
end
end)
You can also assign the object.Parent like local object2 = object.Parent to a variable which would make it better but I just gave this code as an example on how to make the code run a bit more efficient and look better.