How can I add all of the objects into the list and not just the objects after the last “and”
local list = game.Workspace.ZednovTycoonKit.Tycoons.Castle2.PurchasedObjects:GetChildren() and game.Workspace.ZednovTycoonKit.Tycoons.Castle4.PurchasedObjects:GetChildren() and game.Workspace.ZednovTycoonKit.Tycoons.Castle3.PurchasedObjects:GetChildren() and game.Workspace.ZednovTycoonKit.Tycoons.Castle1.PurchasedObjects:GetChildren()
The return is just
game.Workspace.ZednovTycoonKit.Tycoons.Castle1.PurchasedObjects:GetChildren()
Full script for more understanding
local list = game.Workspace.ZednovTycoonKit.Tycoons.Castle2.PurchasedObjects:GetChildren() and game.Workspace.ZednovTycoonKit.Tycoons.Castle4.PurchasedObjects:GetChildren() and game.Workspace.ZednovTycoonKit.Tycoons.Castle3.PurchasedObjects:GetChildren() and game.Workspace.ZednovTycoonKit.Tycoons.Castle1.PurchasedObjects:GetChildren()
local temp2 = nil
for x = 1, #list do
if (list[x].Name == "Spawn1") then
temp2 = list[x].Robot
end
if (list[x].Name == "Spawn2") then
temp2 = list[x].Bull
end
if (list[x].Name == "Spawn3") then
temp2 = list[x].EvilGiant
end
if (list[x].Name == "Spawn6") then
temp2 = list[x]
end
if (list[x].Name == "Walls1") then
temp2 = list[x]
end
if (list[x].Name == "OwnerOnlyDoor") then
temp2 = list[x]
end
if (temp2.className == "Model") and (temp2 ~= script.Parent) then