lighting = game:GetService("Lighting")
assets = lighting.Assets
items = assets.Items
loot = {}
for _, child in pairs(workspace.Loot:GetChildren()) do
table.insert(loot, child.Name)
end
common = {
"Part"
}
uncommon = {
"CornerWedge"
}
rare = {
"Truss"
}
legendary = {
"Wedge"
}
exotic = {
"WedgeLarge"
}
function spawnloot()
for _, v in pairs(loot) do
local item
if v.Name == "Common" then
item = common[math.random(#common)]
elseif v.Name == "Uncommon" then
item = uncommon[math.random(#uncommon)]
elseif v.Name == "Rare" then
item = rare[math.random(#rare)]
elseif v.Name == "Legendary" then
item = legendary[math.random(#legendary)]
elseif v.Name == "Exotic" then
item = exotic[math.random(#exotic)]
end
if item then
local randomloot = items[item]:Clone()
randomloot.Parent = game.Workspace
randomloot.CFrame = v.CFrame
end
end
end
while true do
wait(1) --360 seconds; 6 minutes
spawnloot()
end
Why won't the loot spawn? Thanks!

2 comments
I updated my script, and it still doesnt work, but I have no errors still??
... Read what I said, carefully. Read WHY I said to make the changes I did. In particular, pay attention to what I just bolded.