-- script
local ta = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0)
local properties = {
BackgroundTransparency = 0
}
local create = ta:Create(game.StarterGui.ScreenGui.White_screen,tweeninfo,properties)
create:Play()
Please give more context. If you want to make a white screen with a GUI, you should just create a screenGUI, and put a frame inside of it with scale set to {(1,0),(1,0)}.
local playerGui = game.Players.LocalPlayer.PlayerGui
local ta = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0)
local properties = {
BackgroundTransparency = 0
}
local create = ta:Create(playerGui.ScreenGui.White_screen,tweeninfo,properties)
create:Play()
Make a local script inside the “ScreenGui” that is inside the StarterGui, I also recommend you change the ScreenGui’s name to something like “Interface”.
Inside that local script is where you want your code, and since the localscript will be inside the gui you are editing, you can do “script.Parent.White_screen” to access that White_screen frame.
Taking Zachary’s code from before, it becomes:
-- // variables // --
local TweenService = game:GetService("TweenService")
local WhitescreenFrame = script.Parent:WaitForChild("White_screen") -- wait for it to be there
-- you don't need to give all parameters for TweenInfo.new
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
-- // do the actual tweening // --
local backgroundFade = TweenService:Create(WhitescreenFrame, tweeninfo, {
BackgroundTransparency = 0, -- change properties inside this table
})
backgroundFade:Play()