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

cant figure out how to do this ?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Output: 22:15:18.345 - Page is not a valid member of Frame 22:15:18.346 - Script 'Players.Player.PlayerGui.Catalog.LocalScript', Line 41 - global UpdateSlots 22:15:18.348 - Script 'Players.Player.PlayerGui.Catalog.LocalScript', Line 49 22:15:18.349 - Stack End

local gui = script.Parent
local settings = gui.Main.Settings
local button = gui.Main.TextButton
local catalog = gui.Main.Catalog
local catalogmain = catalog.CatalogMain
local insertbutton = settings.TextButton

button.MouseButton1Up:connect (function()
    catalog.Visible = not  catalog.Visible
    if catalog.Visible == true then
        button.Text = "Catalog: Open"
    else
        button.Text = "Catalog: Close"
    end
end)

--repeat wait() until game.Lighting:FindFirstChild("Catalog")
function getMyPack()
    return game.Lighting:FindFirstChild("Catalog")
end

function UpdateSlots()
    local x, y = 0, 0.2
    local pack = getMyPack()
    local lo = pack.Hats:getChildren()
    for _, child in pairs(lo) do
       local new = insertbutton:Clone()
        new.Position = UDim2.new(x, 0, y, 0)
        new.Text = child.Name
        new.Item.Value = child.Value
        new.Item.MinValue = child.Type.Value
        x = x + 0.6
        if x > 0.6 then
            y = y + 0.1
            x = 0
        end
        if y >= 0.8 then
            settings.Page.Value = settings.Page.Value + 1
            y = 0.2
        elseif y <= 0.8 then
            new.Parent = catalogmain.Hats.Page..settings.Page.Value
        end
    end
end

local pack = getMyPack()
pack.Hats.ChildAdded:connect( UpdateSlots )
pack.Hats.ChildRemoved:connect( UpdateSlots )
UpdateSlots()
0
i was trying to do it same as button.Text = "test"..settings.Page.Value Layfonex 0 — 9y
0
Not even a description of the script? NotsoPenguin 705 — 9y
0
i want [new.Parent = catalogmain.Hats.Page] Page1,#settings.Page.Value Layfonex 0 — 9y
0
ive seriously tried everything :p its not working the way i want it to v.v Layfonex 0 — 9y
View all comments (2 more)
0
Maybe "settings.Page" is nonexistent, or it's in the wrong location. Redbullusa 1580 — 9y
0
no its called page1,page3,page4 etc but iam stuck at this problem Layfonex 0 — 9y

Answer this question