A Roblox Bug or Script?

Greetings everyone! So I made a script where when you press the gui button, a frame tweens. But here´s comes the problem, everytime I click the button, the frame goes on the side of the screen. I tried to change the position but again, the frame went on the side of the screen.

Here´s the script:

local settingsFrame = script.Parent.Parent.SettingsFrame

button.MouseButton1Click:Connect(function()
	if settingsFrame.Position == UDim2.new({0.5, 0},{0, -500}) then
		settingsFrame:TweenPosition(UDim2.new({0.5, 0},{0, 0}), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 2)
	else
		settingsFrame:TweenPosition(UDim2.new({0.5, 0},{0, -500}), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 2)
	end
end)

Please help me!

Remove these things {} from the UDim2.

(I honestly forgot what they were called.)

2 Likes

They are called braces if I’m not wrong

2 Likes

Can you explain why I need to remove the curly brackets {}?

I just googled and it said curly brackets or braces so we cool.

I used the translator, in Italian they are called:
Parentesi Graffa
Translated that and it gave me braces

1 Like

cuz UDim2.new() is a function that expects parameters of type numbers and here you are passing a table to it

2 Likes

Thx for the explanation, the topic is now finished.

1 Like

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