Help with Tweening Size

I’m working on a GUI Button effect, when you click it down, it’s size goes down, when you when you unclick it, its size goes back to normal. I’ve been working on this for a little but the button doesnt change its size. The output doesnt give me any error. Anyone know why it isnt working.

for i,v in pairs(GUI.Tokens:WaitForChild("List"):GetChildren()) do
	if v:IsA("Frame") then
		
		v:WaitForChild("BTN"):WaitForChild("Purchase").MouseButton1Down:Connect(function()
			v:WaitForChild("BTN"):WaitForChild("Purchase"):TweenSize(UDim2.new(0, 136,0, 26), "In", "Quint",  .05)
		end)

		v:WaitForChild("BTN"):WaitForChild("Purchase").MouseButton1Up:Connect(function()
			v:WaitForChild("BTN"):WaitForChild("Purchase"):TweenSize(UDim2.new(0, 143,0, 30), "Out", "Quint",  .05)
		end)
		
		local player = game.Players.LocalPlayer
		v:WaitForChild("BTN"):WaitForChild("Purchase").MouseButton1Click:Connect(function()
			script.Parent.Click:Play()
			
			local ID = v:WaitForChild("ID").Value
			MPS:PromptProductPurchase(player, ID)
			
			MPS.PromptPurchaseFinished:Connect(function()
				GUI.Purchase:Play()			
			end)
		end)
	end
end

The code is missing a tween size for the “BTN” frame before it is clicked. This can be fixed by adding the following before the MouseButton1Down connect:

v:WaitForChild("BTN"):TweenSize(UDim2.new(0, 143,0, 30), "Out", "Quint",  .05)

I’m not trying to tween the BTN frame, im trying to tween the button in the frame

Do the same thing but with the button :expressionless:

You don’t think i’ve tried that?? doesnt work :expressionless::expressionless:

1 Like