- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
-
- local function TeleportToOre(ore)
- local iron = ore:FindFirstChild("Iron")
- if iron and ore:IsA("BasePart") then
- player.Character.HumanoidRootPart.CFrame = ore.CFrame
- wait(0.5)
- end
-
- for _, child in ipairs(ore:GetChildren()) do
- TeleportToOre(child)
- end
- end
-
- local function TraverseHierarchy(parent)
- for _, child in ipairs(parent:GetChildren()) do
- if child.Name == "Ore" then
- TeleportToOre(child)
- end
- TraverseHierarchy(child)
- end
- end
-
- TraverseHierarchy(workspace)