I need help on UDim2!

I need help because Udim2 keep dividing by 2! How can I only have it do it once?

local BallFrame = script.Parent
local RS = game:GetService("ReplicatedStorage")
local TS = game:GetService("TweenService")
local info = TweenInfo.new(.3, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 1)
local GrantMP = RS:WaitForChild("GrantMP")
local Cost = RS:WaitForChild("Cost")
local BuyUpgrade = BallFrame:GetChildren()

for i, Button in pairs(BuyUpgrade) do
	if Button:IsA("TextButton") then
		Button.MouseButton1Down:Connect(function()
			
		end)
		Button.MouseEnter:Connect(function()
			TS:Create(Button, info, {Size = UDim2.new(Button.Size.X.Scale, Button.Size.X.Offset/2, Button.Size.Y.Scale, Button.Size.Y.Offset/2)}):Play()
			
		end)
		
	end
	
end

Nevermind

local BallFrame = script.Parent
local RS = game:GetService("ReplicatedStorage")
local TS = game:GetService("TweenService")
local info = TweenInfo.new(.1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
local GrantMP = RS:WaitForChild("GrantMP")
local Cost = RS:WaitForChild("Cost")
local BuyUpgrade = BallFrame:GetChildren()

local Divisible = 1.3 -- Divible by Offset

for i, Button in pairs(BuyUpgrade) do
	if Button:IsA("TextButton") then
		local ButtonX = Button.Size.X
		local ButtonY = Button.Size.Y
		
		Button.MouseButton1Down:Connect(function()
			
		end)
		Button.MouseEnter:Connect(function()
			TS:Create(Button, info, {Size = UDim2.new(Button.Size.X.Scale, Button.Size.X.Offset/Divisible, Button.Size.Y.Scale, Button.Size.Y.Offset/Divisible)}):Play()
		end)
		Button.MouseLeave:Connect(function()
			TS:Create(Button, info, {Size = UDim2.new(Button.Size.X.Scale, ButtonX.Offset, Button.Size.Y.Scale, ButtonY.Offset)}):Play()
			
		end)
	end
	
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.