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

Script is working when I run it, but not when I play it. Do I need a function?

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

0

dont do Instance.new("Frame",ScreenGui -- remove screen gui this way is deprecated) do frame.Parent = game.Players.LocalPlayer.Backpack

0

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.

0

Also caleb, what is the location of your script?

0

oh srry somebody once told me it was

0

Most likely needs a RemoteEvent.

0

The location is just in workspace SteamG0D

1 answer

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