How do i make it so that when i click a part a fading in and out gui appears?
I've been trying to make it so that when you click a part there's a black gui that fades in and fades out for a week and could'nt make it. I've tried using this script wich i put in the GUI
04 | game.ReplicatedStorage.FadeGui.OnClientEvent:Connect( function () |
05 | if debounce = = false then |
07 | if faded = = false then |
10 | script.Parent:WaitForChild(THE GUI OBJECT YOU WANNA FADE).BackgroundTransparency = i |
16 | for i = 1 , 0 , - 0.05 do |
17 | script.Parent:WaitForChild(THE GUI OBJECT YOU WANNA FADE).BackgroundTransparency = i |
And then i put this script in the part
1 | script.Parent.ClickDetector.MouseClick:Connect( function (Character) |
2 | game.ReplicatedStorage.FadeGui:FireClient(game.Players:WaitForChild( "Character.Name" )) |
But it didn't work. Then i tried using this script but when i change it it stops working:
02 | local part = game.Workspace.ClickMe |
04 | local frame = script.Parent.Frame |
08 | local TimeBetweenFade = 3 |
10 | frame.BackgroundTransparency = 1 |
13 | part.ClickDetector.MouseClick:Connect( function () |
18 | frame.BackgroundTransparency = i |
28 | frame.BackgroundTransparency = k |
Example, if i change the TimeBetweenFade, it stops working.
Could anyone please tell me how to do it.
Oh and just to clarify, these aren't my scripts, I just found them.