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

Loading Screen Doesn't Work In Game But Only Studio? HELP!

Yeah so my game I am currently working on has it's own loading screen (YES I DID GET RID OF THE DEFAULT LOADING SCREEN)But once i play it in the ROBLOX player.....It just doesn't play the loading screen?!?! Can someone help!

CODE:

local LBG = script.Parent.LoadingScreen
local LB = script.Parent.LoadingScreen.LoadBar
local LT = script.Parent.LoadingScreen.LOADING

LBG.Visible = true
wait(4)
	LT.Text = "Grab A Sandwhich while we load"
wait(1)
	LB.Size = UDim2.new(0,100, 0,20)
wait(2)
	LB.Size = UDim2.new(0,300, 0,20)
wait(1)
	LB.Size = UDim2.new(0,600, 0,20)
wait(4)
	LB.Size = UDim2.new(0,1200, 0,20)
		LT.Text = "ALMOST THERE"
wait(9)
	LB.Size = UDim2.new(0,1500, 0,20)
		LT.Text = "FINISHED! Give us a second please..."
wait(3)
	LBG.Visible = false

7 comments

0

oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooof

0

What???

0

Is this a localscript or a server script? Also your GUI might go off screen for some devices...

0

The game is only for pc at the moment.It's just a regular script in The StarterGui/ScreenGui

0

Server scripts won’t work with GUIs. Use a local script instead.

0

Hmmm.Okayyyyy. But where would i put it?

0

If LoadingScreen is a ScreenGui in StarterGui, then put it in StarterGui.

1 answer

Use in a Local Script in your GUI You Have No trigger for your script so its doesnt know when to do it you need a

While wait(1) do

Also at the End of the script it will stop the script from function once finished by disabling it

Also i added in some WaitForChild as it will help the script

local LBG = script.Parent:WaitForChild("LoadingScreen")
	local LB = script.Parent.LoadingScreen:WaitForChild("LoadBar") 
--The WaitForChild will Make it wait for the loading screen
	local LT = script.Parent.LoadingScreen:WaitForChild("LOADING")
	 
        while wait(1) do --Trigger
	LBG.Visible = true
	wait(4)
	    LT.Text = "Grab A Sandwhich while we load"
	wait(1)
	    LB.Size = UDim2.new(0,100, 0,20)
	wait(2)
	    LB.Size = UDim2.new(0,300, 0,20)
	wait(1)
	    LB.Size = UDim2.new(0,600, 0,20)
	wait(4)
	    LB.Size = UDim2.new(0,1200, 0,20)
	        LT.Text = "ALMOST THERE"
	wait(9)
	    LB.Size = UDim2.new(0,1500, 0,20)
	        LT.Text = "FINISHED! Give us a second please..."
	wait(3)
	    LBG.Visible = false
        wait(2)
        script.Disabled = true --Stops Script For Player
       end

1 comment

0

Ok! works in studio but i had to break at the end cause it would repeat.But it still doesn't work in the game itself!

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