I need Help making a loading screen script

I been trying to script my own loading screen every time i try it pops up error

7 Likes

what error? need more info to get help bro

5 Likes

It would greatly help if you could show us the error.

4 Likes

can you give more information about the error?

3 Likes

I don’t know what you mean by “pops up error” but this is a simple structure of a loading screen I use on one of my games.


local loadingScreen = script.Parent


local function hideLoadingScreen() 
--You can adjust according to your needs. This function plays a fade out animation to the loading screen
	local frame = loadingScreen.Frame
	local textLabel = frame.TextLabel 
	local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear) 

	local tween = game:GetService("TweenService"):Create(frame, tweenInfo, {BackgroundTransparency = 1})
	local textTween = game:GetService("TweenService"):Create(textLabel, tweenInfo, {TextTransparency = 1})

	tween:Play()
	textTween:Play()
	script.Parent.Parent.MainMenu.Enabled = true

	tween.Completed:Connect(function()
		loadingScreen.Enabled = false
end



game.Workspace:WaitForChild("came")
game.Workspace:WaitForChild("menuplace")
game.Lighting:WaitForChild("Atmosphere")
game.Workspace:WaitForChild("SpawnPart1")
game.Workspace:WaitForChild("SpawnPart2")
game.Workspace:WaitForChild("SpawnPart3")
game.Workspace:WaitForChild("SpawnPart4")
script.Parent.Parent.MainMenu.Frame:WaitForChild("ImageLabel1")
-- The lines above wait for the objects to be loaded
wait(2.5) -- Timer starts once the objects are loaded

--What you want to happen after the timer is done
script.Parent.Parent:WaitForChild("SurfaceGui").Enabled = true
hideLoadingScreen()
2 Likes