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

how can i make the dialog fade out?

i have this fading dialog script, but theres 2 problems with it. the first is, it only fades in and then stays forever, it wont fade out. the second problem is it doesn't show text, it just shows a white screen (background transparency is set to 1 on frame and textlabel)

local TS = game:GetService("TweenService")

local Trigger = workspace.Trigger
local TextLabel = script.Parent

local debouce = false

local time = 1 
local function onTouched(hit)
	if not debounce then
		if not hit then return end
		debouce = true
		TS:Create(TextLabel, TweenInfo.new(time, Enum.EasingStyle.Quad), {Transparency = 1}):Play() 
		wait()
		TS:Create(TextLabel, TweenInfo.new(time, Enum.EasingStyle.Quad), {Transparency = 0}):Play() 
	end
end
Trigger.Touched:Connect(onTouched)

1 answer

It is possible that you didn't give the tween enough time. Increase the wait maybe to time or add a + 0.5 if it doesn't work.

TS:Create(TextLabel, TweenInfo.new(time, Enum.EasingStyle.Quad), {Transparency = 1}):Play() 
wait(time) -- or more if it doesn't work
TS:Create(TextLabel, TweenInfo.new(time, Enum.EasingStyle.Quad), {Transparency = 0}):Play() 

As soon as the tween plays, without finishing, it moves to the next line. Make sure you give more time to the tween.

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