I’m trying to tween these guis but it gives me this error when I run it, “attempt to call a UDim2 value” on line 9 which is on the position value. How do I fix this?
local frame = script.Parent.Parent.Frame
local frame2 = script.Parent.Parent.Frame2
local buttons = game.StarterGui.ShopGui.Buttons
local button = script.Parent.Parent.ImageButton
local button2 = script.Parent
script.Parent.MouseButton1Click:Connect(function()
buttons:TweenSizeAndPosition(
UDim2.new(0.12, 0,0.36, 0),
UDim2.new(-0.137, 0,0.4, 0)
"Out",
"Quad",
.5,
false
)
frame:TweenSizeAndPosition(
UDim2.new(0, 158,0, 248),
UDim2.new(-0.116, 0,0.285, 0),
"Out",
"Quad",
.5,
false
)
frame2:TweenSizeAndPosition(
UDim2.new(-0.11, 0,0.297, 0),
UDim2.new(0, 141,0, 227),
"Out",
"Quad",
.5,
false
)
button2:TweenSizeAndPosition(
UDim2.new(0, 32,0, 28),
UDim2.new(-0.001, 0,0.453, 0),
"Out",
"Quad",
.5,
false
)
button.Rotation = -90
end)