GUI not Changing Position

Hello, I am very new to scripting (also bad at english).
The gui is opening fine
opening script



script.Parent.MouseButton1Down:Connect(function()
	local useless = script.Parent.Parent.Close
	local sell = script.Parent.Parent.Sell
	local text = script.Parent.Parent.Parent.Text
	local button =  script.Parent.Parent.Buy
	button:TweenPosition(
		UDim2.new(0,0,0.992,0),
		"Out",
		"Elastic",
		3
	)
	text:TweenPosition(
		
	   
		
		UDim2.new(0, 0,0.624, 0 ),
		"Out",
		"Bounce",
		3
		
	)
	
	sell:TweenPosition(
		UDim2.new(0.617, 0,0.992, 0),
		"Out",
		"Quint",
		3
	)
	     useless:TweenPosition(
		
		UDim2.new(0.383, 0,0.992, 0),
		
		"InOut",
		"Quad",
		3
	)
end)

but the gui is not going back to it’s original position

The script in closing button

	local useless = game.StarterGui.ScreenGui.Buttons.Close
	local sell = game.StarterGui.ScreenGui.Buttons.Sell
	local text = game.StarterGui.ScreenGui.Text
	local button =  game.StarterGui.ScreenGui.Buttons.Buy
	
	button.Position = UDim2.new(-1, 0,0.922, 0)
	useless.Position= UDim2.new(0.383, 0,0, 100)
	sell.Position = UDim2.new(1, 0,0.992, 0)
	text.Position = UDim2.new(0, 0,-0.624, 0)
end

script.Parent.MouseButton1Down:Connect(function(lol)



		 
reset()
end)

The place link

1 Like

The closing script is the same you are using for opening?
Also the full script would be better if is not a problem

Nope they are two different scripts
i placed the opening script up there too

here i tried this:

local function reset()
	local useless = game.StarterGui.ScreenGui.Buttons.Close
	local sell = script.Parent.Parent.Sell
	local text = script.Parent.Parent.Parent.Text
	local button = script.Parent.Parent.Buy
	
	button.Position = UDim2.new(-1, 0,0.922, 0)
	useless.Position= UDim2.new(0.383, 0,0, 100)
	sell.Position = UDim2.new(1, 0,0.992, 0)
	text.Position = UDim2.new(0, 0,-0.624, 0)
end

script.Parent.MouseButton1Down:Connect(reset)
2 Likes

This still won’t reset the position of useless. Modifying the position of something in StarterGui will not affect its actual displayed position, as GUIs are cloned into each player’s PlayerGui at runtime.

4 Likes

Ty using PlayerGui also fixed that

1 Like