I want to make a thing where if you click the part, a black screen starts to fade in. Then when it is completely faded in(when you can't see anything), you have to wait 3 seconds for you screen to go back to normal. Why is this? (Here is my script)
local qwerty = game.Workspace.Parent.StarterGui.urmommylol.qwerty
script.Parent.ClickDetector.MouseClick:Connect(function()
while qwerty.BackgroundTransparency > 0 do
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 0.1
wait(0.1)
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 0.2
wait(0.1)
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 0.3
wait(0.1)
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 0.4
wait(0.1)
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 0.5
wait(0.1)
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 0.6
wait(0.1)
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 0.7
wait(0.1)
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 0.8
wait(0.1)
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 0.9
wait(0.1)
qwerty.BackgroundTransparency = qwerty.BackgroundTransparency - 1
wait(3)
qwerty.BackgroundTransparency = 1
end
end)
Thank you!

1 comment
Change the local qwerty to "game.StarterGui.urmommylol.qwerty"