What's wrong with my loading bar?

I’ve tried everything I could to fix this, but it doesn’t work. Please help, have a great day.

My output problem: Argument 3 missing or nil
Here’s my script:

local Frame = script.Parent.Parent.Parent.Parent.Frame

local Indicator = script.Parent.Parent.IndicatorFrame

local Load = false

game.ReplicatedFirst:RemoveDefaultLoadingScreen()

if Load == true then

Frame.Visible = false

else

Indicator:TweenSize(UDim2.new(0,0,0,0):Lerp(UDim2.new(575,0,65,0)))

end

if not game:IsLoaded() then

game.Loaded:Wait()

Load = true

print ("Hi")

end
1 Like

I’m sorry what exactly are you trying to do here

You could literally just set the values in your UDim2.new() parameters

1 Like

Which line is erroring? Also the error is exactly what it says, a function is missing the third argument.

You forgot to set an Alpha in your Lerp, although it doesn’t seem needed when you can make it instantly Tween to where you want just by specifying the end result instead

Indicator:TweenSize(UDim2.new(575,0,65,0))
1 Like

I’m pretty sure line 10.___________________

I’m pretty sure Lerp means a certain goal.

Lerp accepts 2 parameters, the goal, and the alpha (which is a number between 0 and 1), which is where inbetween the goal and the original UDim2 it reaches, you only specified one, but again, you can just specify the end UDim2

1 Like

You could literally just tween the size alone like @EmbatTheHybrid mentioned, the rest of the parameters are completely optional such as:

  • EasingStyles

  • EasingDirections

  • Duration

  • Override Other Tweens

The first parameter will be the goal of the size that you’re wanting to tween, no need to Lerp it

1 Like

I know this is a whole another topic, but when I set Load to true it doesn’t change the Visible to false.

I know this is a whole another topic, but when I set Load to true it doesn’t change the Visible to false. I’m trying to make a loading bar.

Ok but why are you replying to the both of us in separate posts

local Frame = script.Parent.Parent.Parent.Parent.Frame
local Indicator = script.Parent.Parent.IndicatorFrame
local Load = false
game.ReplicatedFirst:RemoveDefaultLoadingScreen()

if Load == true then
    Frame.Visible = false
else
    Indicator:TweenSize(UDim2.new(575, 0, 65, 0))
end

if not game:IsLoaded() then
    game.Loaded:Wait()
    Load = true
    Frame.Visible = false
    print ("Hi")
end

Cause you forgot to set it back to true in your game:IsLoaded() check

1 Like
local ReplicatedFirst = game:GetService('ReplicatedFirst')

local Frame = script.Parent.Parent.Parent.Parent.Frame
local Indicator = script.Parent.Parent.IndicatorFrame

local speed = 8
ReplicatedFirst:RemoveDefaultLoadingScreen()

if game:IsLoaded() then
Indicator:TweenSize(UDim2.new(575, 0, 65, 0), 'Out', 'Linear', 1.8)
wait(1.8)
print('loaded')
wait(.5)
Frame.Visible = false
else
print('loading')
game.Loaded:Wait()

Indicator:TweenSize(UDim2.new(575, 0, 65, 0), 'Out', 'Linear', speed)
wait(speed)

print('loaded')
wait(.5)
Frame.Visible = false
end

It works, but when I play it goes away to fast. Even though you removed the default loading screen.

1 Like

Change the speed variable he placed to be a number greater than 3 to suit your needs

2 Likes

You’ll need to increase the speed variable to a number such as 6.

The speed didn’t work.______________________

Try replacing it with a higher number so the gui does not go away too quickly like 1.5.

I replace this right? local speed = 3

Yeah just the number to a greater value than 3.

I did like 100, 1000, and 10,000