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

How to make a scroll gui based on the number of objects?

Asked by 10 years ago

I am trying to make a script that makes a list of gui inside of a scroll bar gui based on the number of number objects inside of a folder.

Song = script.Parent.Songs
Temp = script.Parent.Template.Frame
Scroll = script.Parent.ScrollingFrame
Children = Song:GetChildren()
Distance = .0025
Print("Varibles Defined")
Log = 0
for i = 1, #Children do
    if Children[i].Classname == "NumberValue" then
    Button = Temp:clone()
    Button.Parent = Scroll
    Button.TextButton.Text = ""..(Children[i].Name)
    Button.TextButton.Value.Value = Children[i].Value
    Button.Position = UDim2.new(0, 0, Log, 0)
    Log = Log + Distance
    end
end 

Answer this question