Hello, I've been trying to create a window that can switch between transparency's but can't figure out the switching between the transparency's part. Here the code I've been using;
local window = script.Parent.Parent
script.Parent.MouseClick:Connect(function()
if window.Transparency = 0.4
window.Transparency = 0
print("Transparency Set to 0!")
else
window.Transparency = 0.4
print("Transparency Set to 0.4!")
end
end)
Thanks for any help!

7 comments
Do you have the windows transparency set to 0.4 before you test? And where is this script located?
I have the window's transparency at 0.4 before starting, and the script is inside a ClickDetector which is inside the part.
Oh, you have your syntax wrong, line 3 should read, if window.Transparency == 0.4 then
Just tried that, didn't work.
Are you getting any errors?
does you click even register? put a print statement inside for testing, maybe you are clicking on something else in front of it. If it is a GUI element set the ZIndex for "script.Parent" element to higher value
As for errors, none. I've set a print for both and it only comes up with the second "Transparency Set to 0.4!" Message.