Loading screen doesn't work

Hello devs!
I’m a bad scripter. Pls don’t judge me.
So i’m trying to make a loading screen for my friend’s game.
And for some reason it doesn’t work, here is my code:

local Frame = script.Parent.Parent.Parent
local LoadingBox = script.Parent
local MathNumber = math.random(1, 3)
local TweenService = game:GetService("TweenService")
print(MathNumber)
if MathNumber == 1 then
	local TweenInfos = TweenInfo.new(
		5,
		Enum.EasingStyle.Quad,
		Enum.EasingDirection.Out,
		0,
		false,
		0
	)
	local TweenGoals = {
	 	UDim2.new(0, 156, 0, 50)
	}
	local Tween = TweenService:Create(LoadingBox, TweenInfos, TweenGoals)
	Tween:Play()
end

and here is my error:Capture d’écran 2021-06-09 104949
Any help is appreciated!
It did print 1

local TweenGoals = {
	 	UDim2.new(0, 156, 0, 50)
	}

to

local TweenGoals = {
	 	Size = UDim2.new(0, 156, 0, 50)
	}
1 Like

So you have to put Size = … well thank you!

1 Like

Yes you gotta specify which property you’re tweening

Okay thank you for the quick help!

1 Like