(Ignore me not using a for loop)
local C = script.Parent local function onMouseClick(Player) while wait(0.1) do C.Parent.Transparency = 0 wait(0.1) C.Parent.Transparency = 0.1 wait(0.1) C.Parent.Transparency = 0.2 wait(0.1) C.Parent.Transparency = 0.3 wait(0.1) C.Parent.Transparency = 0.4 wait(0.1) C.Parent.Transparency = 0.5 wait(0.1) C.Parent.Transparency = 0.6 wait(0.1) C.Parent.Transparency = 0.7 wait(0.1) C.Parent.Transparency = 0.8 wait(0.1) C.Parent.Transparency = 0.9 wait(0.1) C.Parent.Transparency = 1.0 wait(0.1) C.Parent.Transparency = 0.9 wait(0.1) C.Parent.Transparency = 0.8 wait(0.1) C.Parent.Transparency = 0.7 wait(0.1) C.Parent.Transparency = 0.6 wait(0.1) C.Parent.Transparency = 0.5 wait(0.1) C.Parent.Transparency = 0.4 wait(0.1) C.Parent.Transparency = 0.3 wait(0.1) C.Parent.Transparency = 0.2 wait(0.1) C.Parent.Transparency = 0.1 wait(0.1) C.Parent.Transparency = 0 end if C.Parent.Transparency > 0.1 then C:remove() end end C.MouseClick:connect(onMouseClick)
I was wondering why this doesn't get rid of the ClickDetector. I want to do this so that they can't click the part again and mess up the Transparency.
Because you're setting C.Parent.Transparency to 0 and asking if the transparency is greater than .1 in order to delete it.
Maybe because anything outside of your while wait() loop will not function...? No need for it.