Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script not functioning properly or outputing anything?

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

2 comments

3

inventory.ForSale.Value, maybe?

1

'FindFistChild'

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.