So, I have a block with the transparency of 0.5, But I would like it when you click the block the transparency goes to 1.0 then if you click the block again it will return back to 0.5
Thanks for y'all's help!
First put a ClickDetector and BoolValue into your part, and insert this script.
01 | local clickdetector = script.Parent:WaitForChild( "ClickDetector" ) |
02 |
03 | clickdetector.MouseClick:Connect( function (FirstClick) |
04 | if script.Parent.Value.Value = = false then |
05 | script.Parent.Transparency = 1 |
06 | script.Parent.Value.Value = true |
07 | else |
08 | if script.Parent.Value.Value = = true then |
09 | script.Parent.Transparency = 0.5 |
10 | script.Parent.Value.Value = false |
11 | end |
12 | end |
13 | end ) |
Accept my answer if this helps!