So my code works, sort of. It tweens the menu off-screen, but it keeps the text and the button there still, and errors "Unable to cast double to UDim2". I have no clue what this is.

Here is my code:

local Button = script.Parent
local Menu = Button.Parent.Parent.Parent:GetChildren("MenuText", "RoundHolder")

function ButtonClick()
	for _, v in pairs(Menu) do
		v:TweenPosition(UDim2.new(-1, 0, 0, 0))
	break end
	
	local ButtonParent = Button.Parent.Parent
	ButtonParent:TweenPosition(0, 0, 0.38, 0)
end

Button.MouseButton1Click:Connect(ButtonClick)

Does someone know what's wrong? Please help.

*edit, mistake, not tweening button off-screen, i'm just trying to move it to 0.5 x. (scale ofc)

4 comments

1

Use "UDmi2.new(0, 0, 0.38, 0)" for line 10.

0

omg im so dumb

0

thanks

0

ok i tried it, and its working with the button now, but the MenuText just stays where it is.