Hi, I have an issue with GUI Tweening Script

Hello Fellow Robloxians!

I seem to have a problem with my loading screen gui system. I want it to tween the size of this “frame” to the other size, but it seems to not do the tween; heres the script:

game.ReplicatedStorage.joined.OnClientEvent:Connect(function(plr)
	local player = game.Players.LocalPlayer
	
	if player then
		local gui = player.PlayerGui.mucky_loading
		local BO = gui:FindFirstChild("backdrop")
		local inner = BO:FindFirstChild("holder")
		local inset = inner:FindFirstChild("inset")
		
		if inner then
			local TweenService = game:GetService("TweenService")
            local goalUp = { Size = UDim2.new({0, 720},{0, 20})}
 
            local tween = TweenInfo.new(30)
            local tweenup = TweenService:Create(inset, tween, goalUp)
           

gui.Enabled = true
inset.Size = UDim2.new({0, 0},{0, 20})
wait(0.1)
inset:TweenSize(UDim2.new({0, 120},{0, 20}))
wait(5)
inset:TweenSize(UDim2.new({0, 220},{0, 20}))
wait(5)
inset:TweenSize(UDim2.new({0, 320},{0, 20}))
wait(5)
inset:TweenSize(UDim2.new({0, 420},{0, 20}))
wait(5)
inset:TweenSize(UDim2.new({0, 520},{0, 20}))
wait(5)
inset:TweenSize(UDim2.new({0, 620},{0, 20}))
wait(5)
inset:TweenSize(UDim2.new({0, 720},{0, 20}))
wait(5)
    gui.Enabled = false
		end
	end
end)

If you can help me, that will be amazing!

1 Like

I don’t see this being played ever in the code. This could most likely be your issue.

2 Likes

I changed it to this, and it seems to still not work,

gui.Enabled = true
wait(2)
tweenup:Play()
wait(1)
gui.Enabled = false
end
end
end)

1 Like

The tween is playing for 30 seconds, yet you’re hiding the GUI after 1 second.

1 Like

I see, I have changed that to 30 seconds. but it does not seem to change size at all.

1 Like

Well, there are a lot of things I don’t understand.

  1. What is inset? Why are you tweening it?
  2. Why are you using :TweenSize() and TweenService?
  3. Why are you not setting the rest of the values for :TweenSize()?
1 Like

Im not using TweenSize anymore, inset is a frame… which I want to change the size of

You should use the built in function for tweening the size of a frame.

1 Like

The UDim2.new constructor takes 4 numbers, not 2 arrays.
ie.

UDim2.new(0, 720, 0, 20)
1 Like