So, I found this script and i want to use it to make it so that when you click a part, your screen fades to black and then fades out:
local debounce = false
local faded = false
game.ReplicatedStorage.FadeGui.OnClientEvent:Connect(function()
if debounce == false then
debounce = true
if faded == false then
faded = true
for i = 0, 1, 0.05 do
script.Parent:WaitForChild(THE GUI OBJECT YOU WANNA FADE).BackgroundTransparency = i
wait(.05)
end
return -- returning to the beginning of the function to not run the following lines, after setting "faded" to true
else
faded = false
for i = 1, 0, -0.05 do
script.Parent:WaitForChild(THE GUI OBJECT YOU WANNA FADE).BackgroundTransparency = i
wait(.05)
end
debounce = false
end
end)
the thing is that i don't know what a Gui Object is, could anyone tell me?

1 comment
Oh god, I'm so dumb, i actually forgot about the "" in that line, i thought that it could've been the frame, and i wrote the name of the Frame without the "" thinking that i was wrong. That's embarassing lol. Thank you.