Output: Players.Player.PlayerGui.Catalog.LocalScript:15: attempt to call method 'FindFirstChild' (a nil value)
function UpdateItems() local x, y = 0, 0.2 removeOldOutOfTheWay(gui.Main.Items:GetChildren()) local lo = gui.Parent.Parent.Character:GetChildren() for _, child in pairs(lo) do if child.className == "Hat" then local new = settings.Items:Clone() new.Position = UDim2.new(x, 0, y, 0) new.Text = child.Name x = x + 0.031 new.Parent = gui.Main.Items local removed = gui.Main.Items:GetChildren() for i = 1,#removed do removed[i].MouseButton1Up:connect (function() lo:FindFirstChild(removed[i].Text):remove() end) end end end end local a = gui.Parent.Parent.Character a.ChildAdded:connect( UpdateItems ) a.ChildRemoved:connect( UpdateItems ) UpdateItems()
As explained in the comments, 'lo' is a table/list (you created it using :GetChildren).
Replace lo:FindFirstChild
with gui.Parent.Parent.Character:FindFirstChild
.