Hi, thank you for reading. As you can see, all three of them are the except the Name part. What I'm trying to do is that when there is no object in workspace called "Wood" or "Foil" or Nail", then it will spawn into the workspace from Lighting.
local Loot = game.Lighting.Loot:GetChildren()
local Name = "Wood"
while wait(.1) do
if not game.Workspace:findFirstChild(Name) then
for i = 1, #Loot do
if Loot[i] and Loot[i].Name == Name then
local Add = Loot[i]:Clone()
Add.Parent = game.Workspace
if game.Workspace.Part then
Part = workspace.Part
Add:MoveTo(Part.Position)
end
end
end
end
end
local Loot = game.Lighting.Loot:GetChildren()
local Name = "Foil"
while wait(.1) do
if not game.Workspace:findFirstChild(Name) then
for i = 1, #Loot do
if Loot[i] and Loot[i].Name == Name then
local Add = Loot[i]:Clone()
Add.Parent = game.Workspace
if game.Workspace.Part then
Part = workspace.Part
Add:MoveTo(Part.Position)
end
end
end
end
end
local Loot = game.Lighting.Loot:GetChildren()
local Name = "Wood"
while wait(.1) do
if not game.Workspace:findFirstChild(Name) then
for i = 1, #Loot do
if Loot[i] and Loot[i].Name == Name then
local Add = Loot[i]:Clone()
Add.Parent = game.Workspace
if game.Workspace.Part then
Part = workspace.Part
Add:MoveTo(Part.Position)
end
end
end
end
end

8 comments
When the "Wood" part doesn't have those parantheses part, it works. But when I put it into a table, it doesn't work.
In line 7, you made the name equivalent to a table value, which is incorrect. Create a function with some "return" to verify if the name of "Loot's" stuff is equivalent to the argument.
Um, how would I do that? I'm kind of confused to what your saying.
Error on line 7: Attempt to compare 'Loot[i].Name' to 'Name' (A Table Value)'
Can someone show and explain to me how to fix it? It'll help me a lot right now and in the future.
I'd love to but, thats the only thing I saw(Tables).
How do you make those big letters...
@TeenyTanks, I just add 5 of these "-"