Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I am unable to make my GUI slowly fade away. What script will make the GUI fade away?

local debounce = false

local userinputservice = game:GetService("UserInputService")

userinputservice.InputBegan:Connect(function(input, gameProcessedEvent)
	
	if not debounce then
		
		debounce = true
	
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 0.1
	wait(1)
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 0.2
	wait(1)
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 0.3
	wait(1)
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 0.4
	wait(1)
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 0.5
	wait(1)
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 0.6
	wait(1)
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 0.7
	wait(1)
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 0.8
	wait(1)
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 0.9
	wait(1)
	script.Parent.ScreenGui.Frame.BackgroundTransparency = 1
		wait(1)
		
		wait(10)
		
		debounce = false
		
		end
	
	end)
		

1 comment

0

Another GUI Fading script that helped me a lot is this: wait(10) while true do wait (0.06) script.Parent.BackgroundTransparency = script.Parent.BackgroundTransparency + 0.01 if script.Parent.BackgroundTransparency == 1 then end end wait(0.1) script.Parent.Visible = false

1 answer

✓ Accepted answer

Fading GUI script :

local TweenService = game:GetService('TweenService') local Frame = script.Parent

TweenService:Create( Frame, -- UI object you're tweening, in this case it's Frame TweenInfo.new(2), -- Amount of seconds {BackgroundTransparency = 1} -- Goal ):Play() -- Plays your tween

3 comments

0

Did not work. Maybe I didn't put it in properly?

0

wait

0

here try this - https://devforum.roblox.com/t/fading-gui-script/1068731. if you like this, please acceot the answer

This discussion is preserved as it was. New answers, comments, and votes are closed.