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!
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.
local clickdetector = script.Parent:WaitForChild("ClickDetector")
clickdetector.MouseClick:Connect(function(FirstClick)
if script.Parent.Value.Value == false then
script.Parent.Transparency = 1
script.Parent.Value.Value = true
else
if script.Parent.Value.Value == true then
script.Parent.Transparency = 0.5
script.Parent.Value.Value = false
end
end
end)
Accept my answer if this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.