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

How to properly fade? And Tween? [Unanswered]

I've tried the fading several different ways, but it just pops away. Like I destroy it before the fade.

Also, the tweening, it's not smooth. It just pops like I changed the Visible property

a = game.Lighting.Welcome_GUI

game.Players.PlayerAdded:connect(function(p)
	p:WaitForChild("PlayerGui")
	a:clone().Parent = p.PlayerGui
	wait(2)
	p.PlayerGui.Welcome_GUI.ImageLabel:TweenPosition(UDim2.new(0,0,0,0),"Out","Quad",.99)
	repeat
		p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency = p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency + 0.1
		wait(0.01)
	until
	p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency == 1
	p.PlayerGui.Welcome_GUI:Destroy()
end)

3 comments

0

Try changing + 0.1 to less, like 0.05. About tweening, it is very smooth I think.

0

It still didn't fix it. Any other tips?

0

The issue may be because this is being done from the server. Try doing the same code from the client (without the PlayerAdded event of course). Also, check line 12, you use a '==' to set the value. A typo? Should be '='.

1 answer

✓ Accepted answer

The way I fade is, with a loop.

a = game.Lighting.Welcome_GUI

game.Players.PlayerAdded:connect(function(p)
	p:WaitForChild("PlayerGui")
	a:Clone().Parent = p.PlayerGui
	wait(2)
	p.Playergui.WelcomeGUI.ImageLabel:TweenPosition(UDim2.n.ew(0,0,0,0),"Out","Quad", 0.99)
	for i=1, 10 do
		p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency = p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency + 0.1
	end
	p.PlayerGui.Welcome_GUI:Destroy()
end)

This may have some minor typos, I reccomend retyping this just to make sure :P

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