1. local player = game.Players.LocalPlayer
  2. local mouse = player:GetMouse()
  3. local function TeleportToOre(ore)
  4. local iron = ore:FindFirstChild("Iron")
  5. if iron and ore:IsA("BasePart") then
  6. player.Character.HumanoidRootPart.CFrame = ore.CFrame
  7. wait(0.5)
  8. end
  9. for _, child in ipairs(ore:GetChildren()) do
  10. TeleportToOre(child)
  11. end
  12. end
  13. local function TraverseHierarchy(parent)
  14. for _, child in ipairs(parent:GetChildren()) do
  15. if child.Name == "Ore" then
  16. TeleportToOre(child)
  17. end
  18. TraverseHierarchy(child)
  19. end
  20. end
  21. TraverseHierarchy(workspace)