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

Script not functioning properly or outputing anything?

Asked by 7 years ago

The goal of this script is to get all items in an folder, and then get all the slots in a gui (Slots are frames with textlabels in then) and change the TextLabel of the slots accordingly with the items in the folder, but it does not. I get no errors and no output.

Inv = script.Parent.Parent.Parent.Parent:WaitForChild("Inventory")
parent = script.Parent

LastSlot = 0

while wait() do
    for i,inventory in pairs(Inv:GetChildren()) do
        if inventory.ForSale == false then
            LastSlot = LastSlot + 1
            s = parent:FindFistChild("Slot"..LastSlot)
            s.TextLabel.Text = inventory.Name
        end
    end
end
3
inventory.ForSale.Value, maybe? OldPalHappy 1477 — 7y
1
'FindFistChild' Snowskateer2 19 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Okay so I'm assuming ForSale is a Value, so.

Inv = script.Parent.Parent.Parent.Parent:WaitForChild("Inventory")
parent = script.Parent

LastSlot = 0

while wait() do
    for i,inventory in pairs(Inv:GetChildren()) do
        if inventory.ForSale.Value == false then
            LastSlot = LastSlot + 1
            s = parent:FindFirstChild("Slot"..LastSlot)
            s.TextLabel.Text = inventory.Name
        end
    end
end

Also another issue I noticed

s = parent:FindFistChild("Slot"..LastSlot)

But since ForSale was never false, that never got errored. Anymore issues, tell me.

Ad

Answer this question