Frame not fading in and fading out

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

    I want a frame to fade in and fade out

  2. What is the issue? Include screenshots / videos if possible!

    Nothing is happening, the print gets printed out and roblox executes the code but nothing is happening

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

    I couldn’t find anything similar or how to fix it.

The frame’s background transparency to set to 1 at the beginning
image

local plr = game.Players.LocalPlayer
local plrgui = plr:WaitForChild("PlayerGui")
local char = plr.Character
local rs = game:GetService("ReplicatedStorage")
local ui = script.Fading:Clone()
local atable = rs.TableGui
local ts = game:GetService("TweenService")

ui.Parent = plrgui
atable.OnClientEvent:Connect(function()
	print("Fired client")
	local Frame = ui:WaitForChild("Frame")
	local tweeninfo = TweenInfo.new(
		1,
		Enum.EasingStyle.Linear,
		Enum.EasingDirection.In,
		0,
		false,
		0
	)
	local tween1 = ts:Create(
		Frame,
		tweeninfo,
		{BackgroundTransparency = 0}
	)
	local tween2 = ts:Create(
		Frame,
		tweeninfo,
		{BackgroundTransparency = 1}
	)
	tween1:Play()
	tween1.Completed:Wait()
	wait(0.6)
	tween2:Play()
	tween2.Completed:Wait()
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Never mind. The code was correct but I forgot to set the frame to the size I wanted, resulting in a small frame that blended in with the map.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.