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.
Read this, It will answer your question:
https://developer.roblox.com/api-reference/class/PlayerGui