Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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
0
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooof awesomeipod 607 — 6y
0
What??? RoccoAttackYT 8 — 6y
0
Is this a localscript or a server script? Also your GUI might go off screen for some devices... User#20279 0 — 6y
0
The game is only for pc at the moment.It's just a regular script in The StarterGui/ScreenGui RoccoAttackYT 8 — 6y
View all comments (3 more)
0
Server scripts won’t work with GUIs. Use a local script instead. User#20279 0 — 6y
0
Hmmm.Okayyyyy. But where would i put it? RoccoAttackYT 8 — 6y
0
If LoadingScreen is a ScreenGui in StarterGui, then put it in StarterGui. User#20279 0 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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
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! RoccoAttackYT 8 — 6y
Ad

Answer this question