Hello, i have made a loading gui in my game that, once the game fully loads, dissapears, however, if something fails to load, the gui stops working even if the game fully loads Here is my code:
01 | local frame = script.Parent.Frame |
02 | local base = frame.Base |
03 | local bar = base.Bar |
04 | local indicator = base.Indicator |
05 | local skip = base.Skip |
06 | local queue = game.ContentProvider.RequestQueueSize |
07 |
08 | game:GetService( "RunService" ).Stepped:Connect( function () |
09 | indicator.Text = "Loading Assets... (" .. queue .. ")" |
10 | bar.Size = UDim 2. new( 1 /queue, 0 , 1 , 0 ) |
11 | if queue = = 0 then |
12 | indicator.Text = "Assets Loaded!" |
13 | bar.Size = UDim 2. new( 1 , 0 , 1 , 0 ) |
14 | wait( 1 ) |
15 | frame:TweenPosition(UDim 2. new( 0 , 0 , 1 , 0 )) |
16 | end |
17 | end ) |
can anyone help me here???
When using parentheses, you need to make it a long string. Here:
01 | local frame = script.Parent.Frame |
02 | local base = frame.Base |
03 | local bar = base.Bar |
04 | local indicator = base.Indicator |
05 | local skip = base.Skip |
06 | local queue = game.ContentProvider.RequestQueueSize |
07 |
08 | game:GetService( "RunService" ).Stepped:Connect( function () |
09 | indicator.Text = [[Loading Assets... (]] .. queue .. [[)]] |
10 | bar.Size = UDim 2. new( 1 /queue, 0 , 1 , 0 ) |
11 | if queue = = 0 then |
12 | indicator.Text = "Assets Loaded!" |
13 | bar.Size = UDim 2. new( 1 , 0 , 1 , 0 ) |
14 | wait( 1 ) |
15 | frame:TweenPosition(UDim 2. new( 0 , 0 , 1 , 0 )) |
16 | end |
17 | end ) |