local lootables = game.Workspace.Lootables
local objects = {}
for count, instance in pairs(game.Workspace.Lootables:GetChildren()) do
table.insert(objects, instance)
local weaponAttributes = instance:GetAttributes()
for name, value in pairs(weaponAttributes) do
print(name, value)
end
if weaponAttributes.name == "loottable" then
instance:Destroy()
end
end
the part below is what i’m trying to achieve, it is supposed to destroy the trashcan (for testing purposes) but it does not. anyone know why?
if weaponAttributes.name == "loottable" then
instance:Destroy()
end