-- LocalScript in StarterPlayer > StarterPlayerScripts. Spitzhacke vorher ausrüsten. local Players = game:GetService("Players") local RunService = game:GetService("RunService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local zones = workspace:WaitForChild("Zones") local shared = ReplicatedStorage:WaitForChild("Shared") local configOk, zoneConfig = pcall(require, shared:WaitForChild("Config"):WaitForChild("Zones")) assert(configOk and type(zoneConfig) == "table", "Zonen-Konfiguration konnte nicht geladen werden.") local getData = shared:WaitForChild("Remotes"):WaitForChild("GetData") assert(getData:IsA("RemoteFunction"), "GetData muss eine RemoteFunction sein.") local oldGui = playerGui:FindFirstChild("Mine2RockTeleportGui") if oldGui then oldGui:Destroy() end local gui = Instance.new("ScreenGui") gui.Name = "Mine2RockTeleportGui" gui.ResetOnSpawn = false gui.Parent = playerGui local panel = Instance.new("Frame") panel.Size = UDim2.fromOffset(280, 160) panel.AnchorPoint = Vector2.new(0, 0.5) panel.Position = UDim2.new(0, 16, 0.5, 0) panel.BackgroundColor3 = Color3.fromRGB(30, 32, 40) panel.BorderSizePixel = 0 panel.Parent = gui Instance.new("UICorner", panel) local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -60, 0, 44) title.Position = UDim2.fromOffset(12, 0) title.BackgroundTransparency = 1 title.Text = "Rock-Automatik" title.TextColor3 = Color3.new(1, 1, 1) title.Font = Enum.Font.GothamBold title.TextSize = 16 title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = panel local close = Instance.new("TextButton") close.Size = UDim2.fromOffset(44, 44) close.Position = UDim2.new(1, -44, 0, 0) close.BackgroundTransparency = 1 close.Text = "X" close.TextColor3 = Color3.new(1, 1, 1) close.Font = Enum.Font.GothamBold close.TextSize = 20 close.Parent = panel local status = Instance.new("TextLabel") status.Size = UDim2.new(1, -24, 0, 36) status.Position = UDim2.fromOffset(12, 44) status.BackgroundTransparency = 1 status.Text = "Gestoppt | Spitzhacke ausrüsten" status.TextColor3 = Color3.fromRGB(220, 225, 235) status.Font = Enum.Font.Gotham status.TextSize = 14 status.TextWrapped = true status.Parent = panel local toggle = Instance.new("TextButton") toggle.Size = UDim2.new(1, -24, 0, 52) toggle.Position = UDim2.fromOffset(12, 92) toggle.BackgroundColor3 = Color3.fromRGB(155, 45, 55) toggle.Text = "AUS - Einschalten" toggle.TextColor3 = Color3.new(1, 1, 1) toggle.Font = Enum.Font.GothamBold toggle.TextSize = 18 toggle.Parent = panel Instance.new("UICorner", toggle) local enabled = false local selectedZone local rocks local target local nextClickAt = 0 local pollThread local function chooseZone(unlocked) for index = #zoneConfig, 1, -1 do local zone = zoneConfig[index] if unlocked[zone.Id] == true then return zone end end end local function getRockPart(rock) if rock:IsA("BasePart") then return rock elseif rock:IsA("Model") then return rock.PrimaryPart or rock:FindFirstChildWhichIsA("BasePart", true) end end local function chooseRock() local fallback for _, rock in ipairs(rocks:GetChildren()) do if getRockPart(rock) then fallback = fallback or rock if rock:FindFirstChildWhichIsA("Highlight", true) then return rock end end end return fallback end local function stop() enabled = false selectedZone = nil rocks = nil target = nil if pollThread then task.cancel(pollThread) pollThread = nil end end toggle.Activated:Connect(function() if enabled then stop() status.Text = "Gestoppt" else enabled = true nextClickAt = 0 status.Text = "Prüfe freigeschaltete Zonen..." pollThread = task.spawn(function() while enabled and gui.Parent do local ok, data = pcall(function() return getData:InvokeServer() end) if not enabled or not gui.Parent then return end if ok and type(data) == "table" and type(data.UnlockedZones) == "table" then local best = chooseZone(data.UnlockedZones) if selectedZone ~= best then selectedZone = best target = nil end status.Text = best and ("Zone: " .. (best.Name or best.Id)) or "Keine freigeschaltete Zone gefunden" else selectedZone = nil target = nil status.Text = "Spielerdaten fehlen - erneuter Versuch..." warn("[Rock-Automatik] GetData fehlgeschlagen oder UnlockedZones fehlt.") end task.wait(3) end end) end toggle.Text = enabled and "AN - Ausschalten" or "AUS - Einschalten" toggle.BackgroundColor3 = enabled and Color3.fromRGB(30, 120, 70) or Color3.fromRGB(155, 45, 55) end) local heartbeat = RunService.Heartbeat:Connect(function() if not enabled or not selectedZone then return end local character = player.Character local root = character and character:FindFirstChild("HumanoidRootPart") local humanoid = character and character:FindFirstChildOfClass("Humanoid") if not root or not humanoid or humanoid.Health <= 0 then return end local zone = zones:FindFirstChild(selectedZone.Id) local folder = zone and zone:FindFirstChild("Rocks") if rocks ~= folder then rocks = folder target = nil end if not rocks then status.Text = "Warte auf Zone: " .. (selectedZone.Name or selectedZone.Id) return end if not target or target.Parent ~= rocks or not getRockPart(target) then target = chooseRock() end local part = target and getRockPart(target) if part then status.Text = "Zone: " .. (selectedZone.Name or selectedZone.Id) -- shortcut: Fester Abstand; bei großen Rocks anhand der BoundingBox berechnen. local position = part.Position + Vector3.new(0, 5, 0) character:PivotTo(CFrame.new(position) * root.CFrame.Rotation) root.AssemblyLinearVelocity = Vector3.zero root.AssemblyAngularVelocity = Vector3.zero if os.clock() >= nextClickAt then nextClickAt = os.clock() + 0.1 local tool = character:FindFirstChildOfClass("Tool") if tool and tool.Enabled then tool:Activate() tool:Deactivate() end end else status.Text = (selectedZone.Name or selectedZone.Id) .. ": Warte auf Rocks..." end end) gui.Destroying:Connect(function() stop() heartbeat:Disconnect() end) close.Activated:Connect(function() gui:Destroy() end) script.Destroying:Connect(function() gui:Destroy() end)