Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would you make a block that transparent go opaque and back transparent again?

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!

1 answer

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.