Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get a certain gui from for loop help?

Asked by
NotSoNorm 777 Moderation Voter
9 years ago

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)
0
Please try to be more specific with your question. We need more details to understand the problem in order to fix it. Validark 1580 — 9y

Answer this question