I am making an intro sequence for my game. The script is supposed to create a frame which fades from black to another gui. Here's the code:
--Fade in parts--
local size = UDim2.new(0, 1920,0, 1080)
local pos = UDim2.new(0, 0,0, 0)
local color = Color3.new(0,0,0)
local ScreenGui = Instance.new("ScreenGui",game.StarterGui)
local frame = Instance.new("Frame",ScreenGui)
frame.Size = size
frame.Position = pos
frame.BackgroundColor3=color
--Fade in--
wait(1)
for i = 0, 1, 0.025 do
frame.BackgroundTransparency = i
wait(.025)
end
Do I need to add a onPlayerAdded function? I am quite new to this whole scripting thing.

6 comments
dont do Instance.new("Frame",ScreenGui -- remove screen gui this way is deprecated) do frame.Parent = game.Players.LocalPlayer.Backpack
What? Why would you think that's deprecated? You can't just go around and call things deprecated because you don't use them, they are deprecated because roblox drops support for them.
Also caleb, what is the location of your script?
oh srry somebody once told me it was
Most likely needs a RemoteEvent.
The location is just in workspace SteamG0D