Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do you make it when you use ClickDetector the block changes transparent each click?

Asked by 7 years ago

like when you use a ClickDetector on a block and when you click it the transparent changes each time you click it.

I was thinking it was kinda script

script.Parent.ClickDetector.MouseClick:Connect(function()
        script.Parent.Transparency()
end)

Would be nice to fix, or make a script!

1 answer

Log in to vote
0
Answered by 7 years ago

Adding transparency:

script.Parent.Transparency = 0
script.Parent.ClickDetector.MouseClick:connect(function()
        script.Parent.Transparency = script.Parent.Transparency + 0.1
end)

Subtracting transparency:

script.Parent.Transparency = 1
script.Parent.ClickDetector.MouseClick:connect(function()
        script.Parent.Transparency = script.Parent.Transparency - 0.1
end)

If there are issues, please comment. If this helped, upvote and accept answer. Thank you!

1
Thank you this worked! I would like it if you bump my question up! Only if you want, but thanks for the answer! ZAZC_Noob 7 — 7y
Ad

Answer this question