So I want to get a certain gui that's Y Scale < 0 then make all those guis invisible (same for > 1) but it's not working, in a weird way, What's wrong?

MainFrame = script.Parent.MainFrame
Materials = MainFrame.Materials:GetChildren()

MainFrame.Down.MouseButton1Down:connect(function()
	for i = 1, #Materials do
		Materials[i]:TweenPosition(UDim2.new(0, 0,Materials[i].Position.Y.Scale + .1, 0),"Out","Linear",.2,false)
	end
	for i = 1, #Materials do
		if Materials[i].Position.Y.Scale < 0 then
			Materials[i].Visible = false
		else
			Materials[i].Visible = true
		end
	end
end)

MainFrame.Up.MouseButton1Down:connect(function()
	for i = 1, #Materials do
		Materials[i]:TweenPosition(UDim2.new(0, 0,Materials[i].Position.Y.Scale - .1, 0),"Out","Linear",.2,false)
	end
	for i = 1, #Materials do
		if Materials[i].Position.Y.Scale > 1 then
			Materials[i].Visible = false
		else
			Materials[i].Visible = true
		end
	end
end)

2 comments

0

Please try to be more specific with your question. We need more details to understand the problem in order to fix it.