function AnimationController:CreateMainGUI() if self.IsClosed then return end if self.Gui then self.Gui:Destroy() end local C = { bg = Color3.fromRGB(24, 24, 30), bgL = Color3.fromRGB(32, 32, 40), btn = Color3.fromRGB(55, 55, 66), btnH = Color3.fromRGB(70, 70, 82), active = Color3.fromRGB(59, 130, 246), activeH = Color3.fromRGB(120, 190, 255), text = Color3.fromRGB(232, 232, 238), dim = Color3.fromRGB(150, 150, 162), stroke = Color3.fromRGB(60, 60, 74), sub = Color3.fromRGB(42, 42, 52), danger = Color3.fromRGB(220, 60, 60), green = Color3.fromRGB(39, 90, 55), red = Color3.fromRGB(120, 30, 30), } self.Gui = Instance.new("ScreenGui") self.Gui.Name = "AnimationControllerUI" self.Gui.Parent = player:WaitForChild("PlayerGui") self.Gui.ResetOnSpawn = false self.Gui.IgnoreGuiInset = true self.Gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling -- ========== 工具函数 ========== local function corner(p, r) local c = Instance.new("UICorner") c.CornerRadius = UDim.new(0, r or 8); c.Parent = p; return c end local function mkBtn(parent, name, text) local b = Instance.new("TextButton") b.Name = name b.Size = UDim2.new(1, 0, 0, 32) b.BackgroundColor3 = C.btn b.BorderSizePixel = 0 b.Text = text or name b.TextColor3 = C.text b.Font = Enum.Font.GothamMedium b.TextSize = 13 b.TextXAlignment = Enum.TextXAlignment.Left b.AutoButtonColor = false b.Parent = parent corner(b, 6) local u = Instance.new("UIPadding") u.PaddingLeft = UDim.new(0, 14); u.Parent = b b.MouseEnter:Connect(function() if b.BackgroundColor3 ~= C.active then b.BackgroundColor3 = C.btnH end end) b.MouseLeave:Connect(function() if b.BackgroundColor3 ~= C.active then b.BackgroundColor3 = C.btn end end) return b end local function mkSub(parent, text) local b = Instance.new("TextButton") b.Size = UDim2.new(1, -14, 0, 26) b.BackgroundColor3 = C.sub b.BorderSizePixel = 0 b.Text = text b.TextColor3 = C.dim b.Font = Enum.Font.Gotham b.TextSize = 12 b.TextXAlignment = Enum.TextXAlignment.Left b.AutoButtonColor = false b.Visible = false b.Parent = parent corner(b, 5) local u = Instance.new("UIPadding") u.PaddingLeft = UDim.new(0, 26); u.Parent = b return b end local function setState(btn, active) btn.BackgroundColor3 = active and C.active or C.btn btn.TextColor3 = active and Color3.fromRGB(255, 255, 255) or C.text end -- ========== 圆形按钮 ========== local circle = Instance.new("TextButton") circle.Name = "CircleButton" circle.Size = UDim2.new(0, 60, 0, 60) circle.Position = UDim2.new(1, -80, 1, -80) circle.BackgroundColor3 = C.active circle.Text = "⚙" circle.TextColor3 = Color3.fromRGB(255, 255, 255) circle.TextSize = 26 circle.Font = Enum.Font.GothamBold circle.AutoButtonColor = false circle.Parent = self.Gui corner(circle, 30) local cs = Instance.new("UIStroke") cs.Color = C.activeH; cs.Thickness = 2; cs.Transparency = 0.2; cs.Parent = circle -- ========== 主面板 ========== local panel = Instance.new("Frame") panel.Name = "MainPanel" panel.Size = UDim2.new(0, 660, 0, 440) panel.Position = UDim2.new(0.5, -330, 0.5, -220) panel.BackgroundColor3 = C.bg panel.BorderSizePixel = 0 panel.Visible = false panel.Active = true panel.Parent = self.Gui corner(panel, 14) local ps = Instance.new("UIStroke") ps.Color = C.stroke; ps.Thickness = 1; ps.Transparency = 0.2; ps.Parent = panel -- 标题栏 local titleBar = Instance.new("Frame") titleBar.Size = UDim2.new(1, 0, 0, 44) titleBar.BackgroundColor3 = C.bgL titleBar.BorderSizePixel = 0 titleBar.Parent = panel corner(titleBar, 14) local tf = Instance.new("Frame") tf.Size = UDim2.new(1, 0, 0, 14) tf.Position = UDim2.new(0, 0, 1, -14) tf.BackgroundColor3 = C.bgL tf.BorderSizePixel = 0 tf.Parent = titleBar local title = Instance.new("TextLabel") title.Size = UDim2.new(1, -100, 1, 0) title.Position = UDim2.new(0, 16, 0, 0) title.BackgroundTransparency = 1 title.Text = "清水GB脚本 · v6.1" title.TextColor3 = C.text title.Font = Enum.Font.GothamBold title.TextSize = 14 title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = titleBar local closeBtn = Instance.new("TextButton") closeBtn.Size = UDim2.new(0, 28, 0, 28) closeBtn.Position = UDim2.new(1, -38, 0, 8) closeBtn.BackgroundColor3 = C.danger closeBtn.Text = "✕" closeBtn.TextColor3 = Color3.fromRGB(255, 255, 255) closeBtn.Font = Enum.Font.GothamBold closeBtn.TextSize = 13 closeBtn.Parent = titleBar corner(closeBtn, 7) -- 左侧分类栏 local sidebar = Instance.new("ScrollingFrame") sidebar.Size = UDim2.new(0, 155, 1, -58) sidebar.Position = UDim2.new(0, 10, 0, 52) sidebar.BackgroundColor3 = C.bgL sidebar.BorderSizePixel = 0 sidebar.ScrollBarThickness = 3 sidebar.ScrollBarImageColor3 = C.stroke sidebar.CanvasSize = UDim2.new(0, 0, 0, 0) sidebar.AutomaticCanvasSize = Enum.AutomaticSize.Y sidebar.Parent = panel corner(sidebar, 10) local sl = Instance.new("UIListLayout") sl.Padding = UDim.new(0, 4) sl.HorizontalAlignment = Enum.HorizontalAlignment.Center sl.SortOrder = Enum.SortOrder.LayoutOrder sl.Parent = sidebar local sp = Instance.new("UIPadding") sp.PaddingTop = UDim.new(0, 8); sp.PaddingBottom = UDim.new(0, 8) sp.PaddingLeft = UDim.new(0, 6); sp.PaddingRight = UDim.new(0, 6) sp.Parent = sidebar -- 右侧内容区 local contentScroll = Instance.new("ScrollingFrame") contentScroll.Size = UDim2.new(1, -180, 1, -58) contentScroll.Position = UDim2.new(0, 170, 0, 52) contentScroll.BackgroundColor3 = C.bgL contentScroll.BorderSizePixel = 0 contentScroll.ScrollBarThickness = 4 contentScroll.ScrollBarImageColor3 = C.stroke contentScroll.CanvasSize = UDim2.new(0, 0, 0, 0) contentScroll.AutomaticCanvasSize = Enum.AutomaticSize.Y contentScroll.Parent = panel corner(contentScroll, 10) local contentContainer = Instance.new("Frame") contentContainer.Size = UDim2.new(1, 0, 0, 0) contentContainer.AutomaticSize = Enum.AutomaticSize.Y contentContainer.BackgroundTransparency = 1 contentContainer.Parent = contentScroll local ccl = Instance.new("UIListLayout") ccl.Padding = UDim.new(0, 5) ccl.SortOrder = Enum.SortOrder.LayoutOrder ccl.HorizontalAlignment = Enum.HorizontalAlignment.Center ccl.Parent = contentContainer local ccp = Instance.new("UIPadding") ccp.PaddingTop = UDim.new(0, 10); ccp.PaddingBottom = UDim.new(0, 10) ccp.PaddingLeft = UDim.new(0, 6); ccp.PaddingRight = UDim.new(0, 6) ccp.Parent = contentContainer -- ========== 分类 ========== local CATS = { {name = "主动画", icon = "🎭"}, {name = "特别动画", icon = "✨"}, {name = "战斗", icon = "⚔"}, {name = "视觉", icon = "👁"}, {name = "自动化", icon = "🔧"}, {name = "移动", icon = "🏃"}, {name = "其他", icon = "📦"}, } for _, cat in ipairs(CATS) do local f = Instance.new("Frame") f.Name = cat.name f.Size = UDim2.new(1, 0, 0, 0) f.AutomaticSize = Enum.AutomaticSize.Y f.BackgroundTransparency = 1 f.Visible = false f.Parent = contentContainer local fl = Instance.new("UIListLayout") fl.Padding = UDim.new(0, 5) fl.SortOrder = Enum.SortOrder.LayoutOrder fl.Parent = f cat.Frame = f end -- ========== 主动画分类 ========== for _, config in ipairs(self.MainButtonConfigs) do local button = mkBtn(CATS[1].Frame, config.Name, config.Name) local buttonData = {Instance = button, IsActive = false, Tracks = {}, Connections = {}} self.ActiveButtons[config.Name] = buttonData button.MouseButton1Click:Connect(function() if config.Name == "骑兵动画(刺)" then button.BackgroundColor3 = C.btn buttonData.IsActive = false self:PlayCavalryAnimation() else self:ToggleAnimation(config, buttonData) end end) end -- ========== 特别动画分类 ========== for _, config in ipairs(self.SideButtonConfigs) do local button = mkBtn(CATS[2].Frame, config.Name, config.Name) local buttonData = {Instance = button, IsActive = false, Tracks = {}, Connections = {}} self.ActiveButtons[config.Name] = buttonData button.MouseButton1Click:Connect(function() self:ToggleAnimation(config, buttonData) end) end -- ============================================================ -- 战斗分类 -- ============================================================ local combatFrame = CATS[3].Frame -- 通用工具 local function getMelee() for _, item in pairs(AnimationController.Character:GetChildren()) do if item:GetAttribute("Melee") then return item end end for _, item in pairs(player.Backpack:GetChildren()) do if item:GetAttribute("Melee") then return item end end return nil end local function distance(target) if not AnimationController.Character or not target or not target:FindFirstChild("HumanoidRootPart") then return math.huge end return (target.HumanoidRootPart.Position - AnimationController.Character.HumanoidRootPart.Position).magnitude end local function getMusket() for _, item in pairs(AnimationController.Character:GetChildren()) do if item:IsA("Tool") and item.Name == "Musket" then return item end end for _, item in pairs(player.Backpack:GetChildren()) do if item:IsA("Tool") and item.Name == "Musket" then return item end end return nil end -- 杀戮光环 local killAuraButton = mkBtn(combatFrame, "杀戮光环", "杀戮光环") local noBarrelsButton = mkSub(combatFrame, "攻击炸药桶: 取消") local autoRotateButton = mkSub(combatFrame, "自动转向: 关闭") local attackDraculaButton = mkSub(combatFrame, "攻击德古拉: 关闭") local killAuraActive = false local attackBarrels = false local autoRotateEnabled = false local attackDraculaEnabled = false local killAuraConnection = nil local function attackZombie(zombie) local weapon = getMelee() if not weapon then return end local range = 10 if weapon.Name == "Pike" then range = 11 elseif weapon.Name == "Axe" then range = 9 end if weapon.Parent ~= AnimationController.Character then weapon.Parent = AnimationController.Character task.wait(0.1) end if autoRotateEnabled then local wasAutoRotate = AnimationController.Humanoid.AutoRotate AnimationController.Humanoid.AutoRotate = false local pos = zombie.HumanoidRootPart.Position AnimationController.Character.HumanoidRootPart.CFrame = CFrame.lookAt( AnimationController.Character.HumanoidRootPart.Position, Vector3.new(pos.X, AnimationController.Character.HumanoidRootPart.Position.Y, pos.Z)) if wasAutoRotate then AnimationController.Humanoid.AutoRotate = true end end if weapon.Name == "Axe" and zombie.State.Value ~= "Stunned" then weapon.RemoteEvent:FireServer("BraceBlock") weapon.RemoteEvent:FireServer("StopBraceBlock") weapon.RemoteEvent:FireServer("FeedbackStun", zombie, zombie.HumanoidRootPart.Position) end if distance(zombie) <= range then weapon.RemoteEvent:FireServer("Swing", "Side") weapon.RemoteEvent:FireServer("HitZombie", zombie, zombie.Head.Position, true) end end local function attackDraculaFn() local weapon = getMelee() if not weapon then return end local dracula = workspace:WaitForChild("Transylvania"):WaitForChild("Modes"):WaitForChild("Boss"):WaitForChild("Dracula") if not dracula or not dracula:FindFirstChild("HumanoidRootPart") then return end local range = 10 if weapon.Name == "Pike" then range = 11 elseif weapon.Name == "Axe" then range = 9 end if weapon.Parent ~= AnimationController.Character then weapon.Parent = AnimationController.Character task.wait(0.1) end if autoRotateEnabled then local wasAutoRotate = AnimationController.Humanoid.AutoRotate AnimationController.Humanoid.AutoRotate = false local pos = dracula.HumanoidRootPart.Position AnimationController.Character.HumanoidRootPart.CFrame = CFrame.lookAt( AnimationController.Character.HumanoidRootPart.Position, Vector3.new(pos.X, AnimationController.Character.HumanoidRootPart.Position.Y, pos.Z)) if wasAutoRotate then AnimationController.Humanoid.AutoRotate = true end end if distance(dracula) <= range then weapon.RemoteEvent:FireServer("Swing", "Side") local args = {"HitZombie", dracula, dracula.Head.Position, true, "Head"} weapon.RemoteEvent:FireServer(unpack(args)) end end killAuraButton.MouseButton1Click:Connect(function() killAuraActive = not killAuraActive setState(killAuraButton, killAuraActive) noBarrelsButton.Visible = killAuraActive autoRotateButton.Visible = killAuraActive attackDraculaButton.Visible = killAuraActive if killAuraActive then killAuraConnection = game:GetService("RunService").Heartbeat:Connect(function() if not killAuraActive or not AnimationController.Character or AnimationController.Humanoid.Health <= 0 then return end for _, zombie in pairs(workspace.Zombies:GetChildren()) do if zombie:IsA("Model") and zombie:FindFirstChild("HumanoidRootPart") then if zombie:GetAttribute("Type") == "Barrel" and not attackBarrels then continue end if distance(zombie) <= 12 and zombie.State.Value ~= "Spawn" then attackZombie(zombie) end end end if attackDraculaEnabled then local dracula = workspace:FindFirstChild("Transylvania") and workspace.Transylvania:FindFirstChild("Modes") and workspace.Transylvania.Modes:FindFirstChild("Boss") and workspace.Transylvania.Modes.Boss:FindFirstChild("Dracula") if dracula and dracula:FindFirstChild("HumanoidRootPart") and distance(dracula) <= 12 then attackDraculaFn() end end end) else if killAuraConnection then killAuraConnection:Disconnect() killAuraConnection = nil end end end) autoRotateButton.MouseButton1Click:Connect(function() autoRotateEnabled = not autoRotateEnabled autoRotateButton.Text = "自动转向: " .. (autoRotateEnabled and "开启" or "关闭") autoRotateButton.BackgroundColor3 = autoRotateEnabled and C.green or C.sub end) noBarrelsButton.MouseButton1Click:Connect(function() attackBarrels = not attackBarrels noBarrelsButton.Text = "攻击炸药桶: " .. (attackBarrels and "启用" or "取消") noBarrelsButton.BackgroundColor3 = attackBarrels and C.green or C.sub end) attackDraculaButton.MouseButton1Click:Connect(function() attackDraculaEnabled = not attackDraculaEnabled attackDraculaButton.Text = "攻击德古拉: " .. (attackDraculaEnabled and "开启" or "关闭") attackDraculaButton.BackgroundColor3 = attackDraculaEnabled and C.red or C.sub end) player.CharacterAdded:Connect(function() if killAuraConnection then killAuraConnection:Disconnect() killAuraConnection = nil end killAuraActive = false; attackBarrels = false; autoRotateEnabled = false; attackDraculaEnabled = false setState(killAuraButton, false) noBarrelsButton.Visible = false; autoRotateButton.Visible = false; attackDraculaButton.Visible = false end) -- 刺刀杀戮光环 local bayonetKillAuraButton = mkBtn(combatFrame, "刺刀杀戮光环", "刺刀杀戮光环") local bayonetNoBarrelsButton = mkSub(combatFrame, "攻击炸药桶: 取消") local bayonetAutoRotateButton = mkSub(combatFrame, "自动转向: 关闭") local isBayonetKillAuraActive = false local bayonetAttackBarrels = false local bayonetAutoRotateEnabled = false local bayonetKillAuraConnection = nil local function executeBayonetAttack(zombie) local weapon = getMusket() if not weapon then return end if weapon.Parent ~= AnimationController.Character then weapon.Parent = AnimationController.Character task.wait(0.1) end if bayonetAutoRotateEnabled then local wasAutoRotate = AnimationController.Humanoid.AutoRotate AnimationController.Humanoid.AutoRotate = false local pos = zombie.HumanoidRootPart.Position AnimationController.Character.HumanoidRootPart.CFrame = CFrame.lookAt( AnimationController.Character.HumanoidRootPart.Position, Vector3.new(pos.X, AnimationController.Character.HumanoidRootPart.Position.Y, pos.Z)) if wasAutoRotate then AnimationController.Humanoid.AutoRotate = true end end local remoteEvent = weapon:FindFirstChild("RemoteEvent") if not remoteEvent then return end local hitPart = zombie:FindFirstChild("Head") or zombie:FindFirstChild("HumanoidRootPart") if not hitPart then return end remoteEvent:FireServer("ThrustBayonet") task.wait(0.1) remoteEvent:FireServer("Bayonet_HitZombie", zombie, hitPart.Position, true) end local function bayonetKillAuraLoop() while isBayonetKillAuraActive and task.wait() do if not AnimationController.Character or AnimationController.Humanoid.Health <= 0 then return end for _, zombie in pairs(workspace.Zombies:GetChildren()) do if zombie:IsA("Model") and zombie:FindFirstChild("HumanoidRootPart") then if zombie:GetAttribute("Type") == "Barrel" and not bayonetAttackBarrels then continue end if zombie:FindFirstChild("Barrel") then continue end if distance(zombie) <= 15 and zombie.State.Value ~= "Spawn" then executeBayonetAttack(zombie) end end end end end bayonetKillAuraButton.MouseButton1Click:Connect(function() isBayonetKillAuraActive = not isBayonetKillAuraActive setState(bayonetKillAuraButton, isBayonetKillAuraActive) bayonetKillAuraButton.Text = isBayonetKillAuraActive and "刺刀杀戮光环(开)" or "刺刀杀戮光环" bayonetNoBarrelsButton.Visible = isBayonetKillAuraActive bayonetAutoRotateButton.Visible = isBayonetKillAuraActive if isBayonetKillAuraActive then bayonetKillAuraConnection = task.spawn(bayonetKillAuraLoop) else if bayonetKillAuraConnection then task.cancel(bayonetKillAuraConnection) bayonetKillAuraConnection = nil end end end) bayonetNoBarrelsButton.MouseButton1Click:Connect(function() bayonetAttackBarrels = not bayonetAttackBarrels bayonetNoBarrelsButton.Text = "攻击炸药桶: " .. (bayonetAttackBarrels and "启用" or "取消") bayonetNoBarrelsButton.BackgroundColor3 = bayonetAttackBarrels and C.green or C.sub end) bayonetAutoRotateButton.MouseButton1Click:Connect(function() bayonetAutoRotateEnabled = not bayonetAutoRotateEnabled bayonetAutoRotateButton.Text = "自动转向: " .. (bayonetAutoRotateEnabled and "开启" or "关闭") bayonetAutoRotateButton.BackgroundColor3 = bayonetAutoRotateEnabled and C.green or C.sub end) player.CharacterAdded:Connect(function() if bayonetKillAuraConnection then task.cancel(bayonetKillAuraConnection) bayonetKillAuraConnection = nil end isBayonetKillAuraActive = false; bayonetAttackBarrels = false; bayonetAutoRotateEnabled = false setState(bayonetKillAuraButton, false) bayonetKillAuraButton.Text = "刺刀杀戮光环" bayonetNoBarrelsButton.Visible = false; bayonetAutoRotateButton.Visible = false end) -- 杀戮机器人 local killBotsButton = mkBtn(combatFrame, "杀戮机器人", "杀戮机器人") local autoRotateBotsButton = mkSub(combatFrame, "自动转向: 关闭") local isKillingBots = false local autoRotateBots = false local killBotsConnection = nil local function rotateToTarget(target) if not autoRotateBots or not target or not target:FindFirstChild("HumanoidRootPart") then return end local humanoid = AnimationController.Humanoid local rootPart = AnimationController.Character:FindFirstChild("HumanoidRootPart") if not humanoid or not rootPart then return end local originalAutoRotate = humanoid.AutoRotate humanoid.AutoRotate = false local targetPos = target.HumanoidRootPart.Position local lookAtPos = Vector3.new(targetPos.X, rootPart.Position.Y, targetPos.Z) rootPart.CFrame = CFrame.lookAt(rootPart.Position, lookAtPos) humanoid.AutoRotate = originalAutoRotate end local function attackBot(bot) local weapon = getMelee() if not weapon then return end if weapon.Parent ~= AnimationController.Character then weapon.Parent = AnimationController.Character task.wait(0.1) end if autoRotateBots then rotateToTarget(bot) end local remoteEvent = weapon:FindFirstChild("RemoteEvent") if not remoteEvent then return end remoteEvent:FireServer("PrepareSwing") remoteEvent:FireServer("Swing", "Side") local head = bot:FindFirstChild("Head") if head then remoteEvent:FireServer("HitZombie", bot, head.Position, true) end end local function killBotsLoop() while isKillingBots and task.wait() do if not AnimationController.Character or AnimationController.Humanoid.Health <= 0 then break end local botsFolder = workspace:FindFirstChild("Bots") if botsFolder then for _, bot in ipairs(botsFolder:GetChildren()) do if bot:IsA("Model") and bot:FindFirstChild("HumanoidRootPart") then if distance(bot) <= 15 then attackBot(bot) task.wait(0.01) end end end end end end killBotsButton.MouseButton1Click:Connect(function() isKillingBots = not isKillingBots setState(killBotsButton, isKillingBots) killBotsButton.Text = isKillingBots and "杀戮机器人(开)" or "杀戮机器人" autoRotateBotsButton.Visible = isKillingBots if isKillingBots then killBotsConnection = task.spawn(killBotsLoop) else if killBotsConnection then task.cancel(killBotsConnection) killBotsConnection = nil end end end) autoRotateBotsButton.MouseButton1Click:Connect(function() autoRotateBots = not autoRotateBots autoRotateBotsButton.Text = "自动转向: " .. (autoRotateBots and "开启" or "关闭") autoRotateBotsButton.BackgroundColor3 = autoRotateBots and C.green or C.sub end) player.CharacterAdded:Connect(function() if killBotsConnection then task.cancel(killBotsConnection) killBotsConnection = nil end isKillingBots = false; autoRotateBots = false setState(killBotsButton, false) killBotsButton.Text = "杀戮机器人" autoRotateBotsButton.Visible = false end) -- PVP 杀戮 local pvpBtn = mkBtn(combatFrame, "PVP杀戮", "PVP杀戮") local isPvpAttacking = false local pvpLoopConn = nil local PVP_RANGE = 15 local function getMeleeBase() for _, tool in ipairs(player.Character:GetChildren()) do if tool:IsA("Tool") and tool:FindFirstChild("MeleeBase") then return tool end end for _, tool in ipairs(player.Backpack:GetChildren()) do if tool:IsA("Tool") and tool:FindFirstChild("MeleeBase") then return tool end end return nil end local function getDistance(target) if not player.Character or not target or not target:FindFirstChild("HumanoidRootPart") then return math.huge end return (target.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).magnitude end local function isSameTeam(targetPlayer) if not player.Team or not targetPlayer.Team then return false end return player.Team == targetPlayer.Team end local function attackPlayer(targetPlayer) if not targetPlayer or not targetPlayer.Character then return end if isSameTeam(targetPlayer) then return end local weapon = getMeleeBase() if not weapon then return end if weapon.Parent ~= player.Character then weapon.Parent = player.Character task.wait(0.1) end local remoteEvent = weapon:FindFirstChild("RemoteEvent") if not remoteEvent then return end remoteEvent:FireServer("PrepareSwing") remoteEvent:FireServer("Swing", "Side") local head = targetPlayer.Character:FindFirstChild("Head") if head then remoteEvent:FireServer("HitPlayer", targetPlayer.Character:FindFirstChild("Humanoid"), head.Position) end end local function pvpLoop() while isPvpAttacking and task.wait() do if not player.Character or player.Character:FindFirstChildOfClass("Humanoid").Health <= 0 then break end for _, targetPlayer in ipairs(game:GetService("Players"):GetPlayers()) do if targetPlayer ~= player and targetPlayer.Character and targetPlayer.Character:FindFirstChild("Humanoid") and targetPlayer.Character.Humanoid.Health > 0 and not isSameTeam(targetPlayer) then if getDistance(targetPlayer.Character) <= PVP_RANGE then attackPlayer(targetPlayer) task.wait(0.01) end end end end end pvpBtn.MouseButton1Click:Connect(function() isPvpAttacking = not isPvpAttacking setState(pvpBtn, isPvpAttacking) pvpBtn.Text = isPvpAttacking and "PVP杀戮(开)" or "PVP杀戮" if isPvpAttacking then pvpLoopConn = task.spawn(pvpLoop) else if pvpLoopConn then task.cancel(pvpLoopConn) pvpLoopConn = nil end end end) player.CharacterAdded:Connect(function() if isPvpAttacking then isPvpAttacking = false setState(pvpBtn, false) pvpBtn.Text = "PVP杀戮" if pvpLoopConn then task.cancel(pvpLoopConn) pvpLoopConn = nil end end end) -- 刺刀PVP杀戮 local bayPvpBtn = mkBtn(combatFrame, "刺刀PVP杀戮", "刺刀PVP杀戮") local isBayPvpAttacking = false local bayPvpLoopConn = nil local BAY_RANGE = 17 local function attackPlayerBay(targetPlayer) if not targetPlayer or not targetPlayer.Character then return end if isSameTeam(targetPlayer) then return end local weapon = getMusket() if not weapon then return end if weapon.Parent ~= player.Character then weapon.Parent = player.Character task.wait(0.1) end local remoteEvent = weapon:FindFirstChild("RemoteEvent") if not remoteEvent then return end remoteEvent:FireServer("ThrustBayonet") local head = targetPlayer.Character:FindFirstChild("Head") if head then remoteEvent:FireServer("Bayonet_HitPlayer", targetPlayer.Character:FindFirstChild("Humanoid"), head.Position) end end local function bayPvpLoop() while isBayPvpAttacking and task.wait() do if not player.Character or player.Character:FindFirstChildOfClass("Humanoid").Health <= 0 then break end for _, targetPlayer in ipairs(game:GetService("Players"):GetPlayers()) do if targetPlayer ~= player and targetPlayer.Character and targetPlayer.Character:FindFirstChild("Humanoid") and targetPlayer.Character.Humanoid.Health > 0 and not isSameTeam(targetPlayer) then if getDistance(targetPlayer.Character) <= BAY_RANGE then attackPlayerBay(targetPlayer) task.wait(0.01) end end end end end bayPvpBtn.MouseButton1Click:Connect(function() isBayPvpAttacking = not isBayPvpAttacking setState(bayPvpBtn, isBayPvpAttacking) bayPvpBtn.Text = isBayPvpAttacking and "刺刀PVP杀戮(开)" or "刺刀PVP杀戮" if isBayPvpAttacking then bayPvpLoopConn = task.spawn(bayPvpLoop) else if bayPvpLoopConn then task.cancel(bayPvpLoopConn) bayPvpLoopConn = nil end end end) player.CharacterAdded:Connect(function() if isBayPvpAttacking then isBayPvpAttacking = false setState(bayPvpBtn, false) bayPvpBtn.Text = "刺刀PVP杀戮" if bayPvpLoopConn then task.cancel(bayPvpLoopConn) bayPvpLoopConn = nil end end end) -- 肘击 local axeStunButton = mkBtn(combatFrame, "AxeStun", "肘击") local isAxeStunActive = false local axeStunConnection = nil local function executeStun(zombie) local weapon = getMelee() if not weapon or weapon.Name ~= "Axe" then return end if zombie.State.Value == "Stunned" then return end weapon.RemoteEvent:FireServer("BraceBlock") weapon.RemoteEvent:FireServer("StopBraceBlock") local Feed = {"FeedbackStun", zombie, zombie.HumanoidRootPart.CFrame.Position} weapon.RemoteEvent:FireServer(unpack(Feed)) end axeStunButton.MouseButton1Click:Connect(function() isAxeStunActive = not isAxeStunActive setState(axeStunButton, isAxeStunActive) if isAxeStunActive then axeStunConnection = game:GetService("RunService").Heartbeat:Connect(function() if not isAxeStunActive or not AnimationController.Character or AnimationController.Humanoid.Health <= 0 then return end for _, zombie in pairs(workspace.Zombies:GetChildren()) do if zombie:IsA("Model") and zombie:FindFirstChild("HumanoidRootPart") then local d = (zombie.HumanoidRootPart.Position - AnimationController.Character.HumanoidRootPart.Position).Magnitude if d <= 15 then executeStun(zombie) end end end end) else if axeStunConnection then axeStunConnection:Disconnect() axeStunConnection = nil end end end) player.CharacterAdded:Connect(function() if axeStunConnection then axeStunConnection:Disconnect() axeStunConnection = nil end isAxeStunActive = false setState(axeStunButton, false) end) -- 卡宾枪肘击 local carbineStunButton = mkBtn(combatFrame, "CarbineCombo", "卡宾枪肘击(多目标)") local isComboActive = false local comboConnection = nil local function getZombiesInRange() if not AnimationController.Character then return {} end local hrp = AnimationController.Character:FindFirstChild("HumanoidRootPart") if not hrp then return {} end local zombies = {} local playerPos = hrp.Position for _, zombie in pairs(workspace.Zombies:GetChildren()) do if zombie:IsA("Model") and zombie:FindFirstChild("HumanoidRootPart") then local d = (zombie.HumanoidRootPart.Position - playerPos).Magnitude if d <= 15 then table.insert(zombies, zombie) end end end table.sort(zombies, function(a, b) return (a.HumanoidRootPart.Position - playerPos).Magnitude < (b.HumanoidRootPart.Position - playerPos).Magnitude end) return zombies end local function executeCarbineComboMulti() local character = player.Character if not character then return end local carbine = player.Backpack:FindFirstChild("Carbine") or character:FindFirstChild("Carbine") if not carbine then return end local remoteEvent = carbine:FindFirstChild("RemoteEvent") if not remoteEvent then return end remoteEvent:FireServer("Shove") task.wait(0.2) local zombies = getZombiesInRange() local maxTargets = math.min(10, #zombies) for i = 1, maxTargets do local zombie = zombies[i] remoteEvent:FireServer("FeedbackStun", zombie, zombie.HumanoidRootPart.CFrame.Position) if i < maxTargets then task.wait(0.1) end end end carbineStunButton.MouseButton1Click:Connect(function() isComboActive = not isComboActive setState(carbineStunButton, isComboActive) if isComboActive then comboConnection = game:GetService("RunService").Heartbeat:Connect(function() if not isComboActive or not AnimationController.Character or AnimationController.Humanoid.Health <= 0 then return end executeCarbineComboMulti() task.wait(0.01) end) else if comboConnection then comboConnection:Disconnect() comboConnection = nil end end end) player.CharacterAdded:Connect(function() if comboConnection then comboConnection:Disconnect() comboConnection = nil end isComboActive = false setState(carbineStunButton, false) end) -- ============================================================ -- 视觉分类 -- ============================================================ local visualFrame = CATS[4].Frame -- 玩家透视 local espButton = mkBtn(visualFrame, "PlayerESPButton", "开启透视") local espEnabled = false local playerHighlights = {} local function getTeamColor(p) if p.Team then return p.Team.TeamColor.Color else return Color3.fromRGB(255, 255, 255) end end local function createPlayerESP(p) if not p.Character then return end if playerHighlights[p] then playerHighlights[p]:Destroy() playerHighlights[p] = nil end local h = Instance.new("Highlight") h.Name = p.Name .. "ESP" h.FillColor = getTeamColor(p) h.OutlineColor = Color3.fromRGB(255, 255, 255) h.FillTransparency = 0.5 h.OutlineTransparency = 0 h.Parent = p.Character local bb = Instance.new("BillboardGui") bb.Name = "PlayerNameTag" bb.Size = UDim2.new(0, 200, 0, 50) bb.StudsOffset = Vector3.new(0, 2.5, 0) bb.AlwaysOnTop = true bb.Adornee = p.Character:WaitForChild("Head") or p.Character:WaitForChild("HumanoidRootPart") bb.Parent = p.Character local lbl = Instance.new("TextLabel") lbl.Text = p.Name .. (p.Team and " ("..p.Team.Name..")" or "") lbl.Size = UDim2.new(1, 0, 1, 0) lbl.BackgroundTransparency = 1 lbl.TextColor3 = getTeamColor(p) lbl.Font = Enum.Font.GothamBold lbl.TextSize = 14 lbl.TextStrokeTransparency = 0.5 lbl.Parent = bb playerHighlights[p] = h end local function removePlayerESP(p) if playerHighlights[p] then playerHighlights[p]:Destroy() playerHighlights[p] = nil end if p.Character then local t = p.Character:FindFirstChild("PlayerNameTag") if t then t:Destroy() end end end local function updateAllPlayerESP() for _, p in ipairs(Players:GetPlayers()) do if espEnabled then createPlayerESP(p) else removePlayerESP(p) end end end local function onPlayerAdded(p) p.CharacterAdded:Connect(function() if espEnabled then espEnabled = false espButton.Text = "开启透视" espButton.BackgroundColor3 = C.btn updateAllPlayerESP() end if espEnabled then createPlayerESP(p) end end) p.CharacterRemoving:Connect(function() removePlayerESP(p) end) pcall(function() p:GetPropertyChangedSignal("Team"):Connect(function() if espEnabled and p.Character then createPlayerESP(p) end end) end) end espButton.MouseButton1Click:Connect(function() espEnabled = not espEnabled if espEnabled then espButton.Text = "关闭透视" setState(espButton, true) updateAllPlayerESP() else espButton.Text = "开启透视" setState(espButton, false) updateAllPlayerESP() end end) for _, p in ipairs(Players:GetPlayers()) do onPlayerAdded(p) end Players.PlayerAdded:Connect(onPlayerAdded) -- 全图高亮 local fullBrightButton = mkBtn(visualFrame, "FullBrightToggleButton", "全图高亮:OFF") fullBrightButton.MouseButton1Click:Connect(function() if not _G.FullBrightExecuted then _G.FullBrightEnabled = false _G.NormalLightingSettings = { Brightness = game:GetService("Lighting").Brightness, ClockTime = game:GetService("Lighting").ClockTime, FogEnd = game:GetService("Lighting").FogEnd, GlobalShadows = game:GetService("Lighting").GlobalShadows, Ambient = game:GetService("Lighting").Ambient } game:GetService("Lighting"):GetPropertyChangedSignal("Brightness"):Connect(function() if game:GetService("Lighting").Brightness ~= 1 and game:GetService("Lighting").Brightness ~= _G.NormalLightingSettings.Brightness then _G.NormalLightingSettings.Brightness = game:GetService("Lighting").Brightness if not _G.FullBrightEnabled then repeat wait() until _G.FullBrightEnabled end game:GetService("Lighting").Brightness = 1 end end) game:GetService("Lighting"):GetPropertyChangedSignal("ClockTime"):Connect(function() if game:GetService("Lighting").ClockTime ~= 12 and game:GetService("Lighting").ClockTime ~= _G.NormalLightingSettings.ClockTime then _G.NormalLightingSettings.ClockTime = game:GetService("Lighting").ClockTime if not _G.FullBrightEnabled then repeat wait() until _G.FullBrightEnabled end game:GetService("Lighting").ClockTime = 12 end end) game:GetService("Lighting"):GetPropertyChangedSignal("FogEnd"):Connect(function() if game:GetService("Lighting").FogEnd ~= 786543 and game:GetService("Lighting").FogEnd ~= _G.NormalLightingSettings.FogEnd then _G.NormalLightingSettings.FogEnd = game:GetService("Lighting").FogEnd if not _G.FullBrightEnabled then repeat wait() until _G.FullBrightEnabled end game:GetService("Lighting").FogEnd = 786543 end end) game:GetService("Lighting"):GetPropertyChangedSignal("GlobalShadows"):Connect(function() if game:GetService("Lighting").GlobalShadows ~= false and game:GetService("Lighting").GlobalShadows ~= _G.NormalLightingSettings.GlobalShadows then _G.NormalLightingSettings.GlobalShadows = game:GetService("Lighting").GlobalShadows if not _G.FullBrightEnabled then repeat wait() until _G.FullBrightEnabled end game:GetService("Lighting").GlobalShadows = false end end) game:GetService("Lighting"):GetPropertyChangedSignal("Ambient"):Connect(function() if game:GetService("Lighting").Ambient ~= Color3.fromRGB(178, 178, 178) and game:GetService("Lighting").Ambient ~= _G.NormalLightingSettings.Ambient then _G.NormalLightingSettings.Ambient = game:GetService("Lighting").Ambient if not _G.FullBrightEnabled then repeat wait() until _G.FullBrightEnabled end game:GetService("Lighting").Ambient = Color3.fromRGB(178, 178, 178) end end) game:GetService("Lighting").Brightness = 1 game:GetService("Lighting").ClockTime = 12 game:GetService("Lighting").FogEnd = 786543 game:GetService("Lighting").GlobalShadows = false game:GetService("Lighting").Ambient = Color3.fromRGB(178, 178, 178) local LatestValue = true spawn(function() repeat wait() until _G.FullBrightEnabled while wait() do if _G.FullBrightEnabled ~= LatestValue then if not _G.FullBrightEnabled then game:GetService("Lighting").Brightness = _G.NormalLightingSettings.Brightness game:GetService("Lighting").ClockTime = _G.NormalLightingSettings.ClockTime game:GetService("Lighting").FogEnd = _G.NormalLightingSettings.FogEnd game:GetService("Lighting").GlobalShadows = _G.NormalLightingSettings.GlobalShadows game:GetService("Lighting").Ambient = _G.NormalLightingSettings.Ambient else game:GetService("Lighting").Brightness = 1 game:GetService("Lighting").ClockTime = 12 game:GetService("Lighting").FogEnd = 786543 game:GetService("Lighting").GlobalShadows = false game:GetService("Lighting").Ambient = Color3.fromRGB(178, 178, 178) end LatestValue = not LatestValue end end end) _G.FullBrightExecuted = true end _G.FullBrightEnabled = not _G.FullBrightEnabled if _G.FullBrightEnabled then fullBrightButton.Text = "全图高亮:ON" setState(fullBrightButton, true) else fullBrightButton.Text = "全图高亮:OFF" setState(fullBrightButton, false) end end) -- 瓦尔多要塞火炮物资透视 local cannonButton = mkBtn(visualFrame, "瓦尔多要塞火炮物资透视", "瓦尔多要塞火炮物资透视") local cannonButtonData = {Instance = cannonButton, IsActive = false, Tracks = {}, Connections = {}} self.ActiveButtons["瓦尔多要塞火炮物资透视"] = cannonButtonData cannonButton.MouseButton1Click:Connect(function() self:ToggleCannonHighlights() end) -- 透视僵尸 local zombieVisionButton = mkBtn(visualFrame, "ZombieVision", "透视僵尸关闭🤔") local zombieVisionData = {Instance = zombieVisionButton, IsActive = false, Tracks = {}, Connections = {}} self.ActiveButtons["ZombieVision"] = zombieVisionData local zombieTags = {} local draculaTag = nil local headlessHorsemanTag = nil local visionConnection = nil local bossESPConnection = nil local ZOMBIE_TYPES = { ["Axe"] = {name = "大师兄Zapper", color = Color3.fromRGB(180, 0, 250), size = UDim2.new(0, 120, 0, 30), priority = 1}, ["Eye"] = {name = "红眼Runner", color = Color3.fromRGB(255, 50, 50), size = UDim2.new(0, 100, 0, 30), priority = 2}, ["Sword"] = {name = "二师兄", color = Color3.fromRGB(200, 30, 60), size = UDim2.new(0, 100, 0, 30), priority = 2}, ["Barrel"] = {name = "自爆Boomber", color = Color3.fromRGB(250, 250, 0), size = UDim2.new(0, 120, 0, 30), priority = 3}, ["FTorso"] = {name = "提灯人_Light", color = Color3.fromRGB(255, 120, 0), size = UDim2.new(0, 120, 0, 30), priority = 4} } local DRACULA_CONFIG = {name = "德古拉", color = Color3.fromRGB(43, 255, 0), size = UDim2.new(0, 150, 0, 40)} local HEADLESS_HORSEMAN_CONFIG = {name = "无头骑士", color = Color3.fromRGB(255, 0, 0), size = UDim2.new(0, 100, 0, 25)} local function findZombies() local zombies = {} local cameraFolder = workspace:FindFirstChild("Camera") if cameraFolder then for _, model in pairs(cameraFolder:GetDescendants()) do if model:IsA("Model") and model.Name:find("Zombie") then table.insert(zombies, model) end end end return zombies end local function findDracula() local d = workspace:FindFirstChild("Transylvania") and workspace.Transylvania:FindFirstChild("Modes") and workspace.Transylvania.Modes:FindFirstChild("Boss") and workspace.Transylvania.Modes.Boss:FindFirstChild("Dracula") return d end local function findHeadlessHorseman() for _, model in pairs(workspace:GetDescendants()) do if model:IsA("Model") and model.Name == "HeadlessHorseman" then return model end end return nil end local function getZombieConfig(zombie) local hp, bc = math.huge, nil for partName, config in pairs(ZOMBIE_TYPES) do if zombie:FindFirstChild(partName) and config.priority < hp then hp = config.priority; bc = config end end return bc end local function createZombieTag(zombie) local cfg = getZombieConfig(zombie) if not cfg then return end if zombieTags[zombie] then zombieTags[zombie]:Destroy() end local attachPart = zombie.PrimaryPart or zombie:FindFirstChild("Head") or zombie:FindFirstChild("HumanoidRootPart") if not attachPart then return end local tag = Instance.new("BillboardGui") tag.Name = "ZombieTag"; tag.Size = cfg.size tag.StudsOffset = Vector3.new(0, 2.5, 0); tag.AlwaysOnTop = true tag.Adornee = attachPart; tag.MaxDistance = 0; tag.Parent = zombie local lbl = Instance.new("TextLabel") lbl.Text = cfg.name; lbl.Size = UDim2.new(1, 0, 1, 0) lbl.BackgroundTransparency = 1; lbl.TextColor3 = cfg.color lbl.Font = Enum.Font.GothamBold; lbl.TextSize = 14; lbl.TextStrokeTransparency = 0.5 lbl.Parent = tag zombieTags[zombie] = tag end local function createDraculaTag(dracula) if draculaTag then draculaTag:Destroy() draculaTag = nil end local a = dracula.PrimaryPart or dracula:FindFirstChild("Head") or dracula:FindFirstChild("HumanoidRootPart") if not a then return end local tag = Instance.new("BillboardGui") tag.Name = "DraculaTag"; tag.Size = DRACULA_CONFIG.size tag.StudsOffset = Vector3.new(0, 3, 0); tag.AlwaysOnTop = true tag.Adornee = a; tag.MaxDistance = 0; tag.Parent = dracula local lbl = Instance.new("TextLabel") lbl.Text = DRACULA_CONFIG.name; lbl.Size = UDim2.new(1, 0, 1, 0) lbl.BackgroundTransparency = 1; lbl.TextColor3 = DRACULA_CONFIG.color lbl.Font = Enum.Font.GothamBold; lbl.TextSize = 16; lbl.TextStrokeTransparency = 0.3 lbl.Parent = tag draculaTag = tag end local function createHeadlessHorsemanTag(h) if headlessHorsemanTag then headlessHorsemanTag:Destroy() headlessHorsemanTag = nil end local a = h.PrimaryPart or h:FindFirstChild("HumanoidRootPart") if not a then return end local tag = Instance.new("BillboardGui") tag.Name = "HeadlessHorsemanTag"; tag.Size = HEADLESS_HORSEMAN_CONFIG.size tag.StudsOffset = Vector3.new(0, 3.5, 0); tag.AlwaysOnTop = true tag.Adornee = a; tag.MaxDistance = 0; tag.Parent = h local lbl = Instance.new("TextLabel") lbl.Text = HEADLESS_HORSEMAN_CONFIG.name; lbl.Size = UDim2.new(1, 0, 1, 0) lbl.BackgroundTransparency = 1; lbl.TextColor3 = HEADLESS_HORSEMAN_CONFIG.color lbl.Font = Enum.Font.GothamBold; lbl.TextSize = 14; lbl.TextStrokeTransparency = 0.3 lbl.Parent = tag headlessHorsemanTag = tag end local function clearZombieTags() for z, t in pairs(zombieTags) do if t and t.Parent then t:Destroy() end end zombieTags = {} if draculaTag then draculaTag:Destroy() draculaTag = nil end if headlessHorsemanTag then headlessHorsemanTag:Destroy() headlessHorsemanTag = nil end end local function setupBossESP() local hh = findHeadlessHorseman() if not hh then return end if bossESPConnection then bossESPConnection:Disconnect() end bossESPConnection = workspace.DescendantAdded:Connect(function(inst) if inst.Name == "HumanoidRootPart" and inst.Parent.Name == "HeadlessHorseman" then createHeadlessHorsemanTag(inst.Parent) end end) for _, v in ipairs(workspace:GetDescendants()) do if v.Name == "HumanoidRootPart" and v.Parent.Name == "HeadlessHorseman" then createHeadlessHorsemanTag(v.Parent) end end end local function updateZombieTags() for z, t in pairs(zombieTags) do if not z.Parent then t:Destroy() zombieTags[z] = nil end end for _, z in pairs(findZombies()) do if not zombieTags[z] then createZombieTag(z) end end local d = findDracula() if d then if not draculaTag or draculaTag.Parent ~= d then createDraculaTag(d) end elseif draculaTag then draculaTag:Destroy() draculaTag = nil end local hh = findHeadlessHorseman() if hh then if not headlessHorsemanTag or headlessHorsemanTag.Parent ~= hh then createHeadlessHorsemanTag(hh) end elseif headlessHorsemanTag then headlessHorsemanTag:Destroy() headlessHorsemanTag = nil end end local function toggleVision() zombieVisionData.IsActive = not zombieVisionData.IsActive if zombieVisionData.IsActive then setState(zombieVisionButton, true) zombieVisionButton.Text = "透视僵尸开启😡" updateZombieTags() if findHeadlessHorseman() then setupBossESP() end visionConnection = game:GetService("RunService").Heartbeat:Connect(function() if not zombieVisionData.IsActive then return end if tick() % 0.5 < 0.016 then updateZombieTags() end end) else setState(zombieVisionButton, false) zombieVisionButton.Text = "透视僵尸关闭🤔" clearZombieTags() if visionConnection then visionConnection:Disconnect() visionConnection = nil end if bossESPConnection then bossESPConnection:Disconnect() bossESPConnection = nil end end end zombieVisionButton.MouseButton1Click:Connect(toggleVision) player.CharacterAdded:Connect(function() if zombieVisionData.IsActive then zombieVisionData.IsActive = false clearZombieTags() if visionConnection then visionConnection:Disconnect() visionConnection = nil end if bossESPConnection then bossESPConnection:Disconnect() bossESPConnection = nil end setState(zombieVisionButton, false) zombieVisionButton.Text = "透视僵尸关闭🤔" end end) player.CharacterRemoving:Connect(function() if zombieVisionData.IsActive then clearZombieTags() if visionConnection then visionConnection:Disconnect() visionConnection = nil end if bossESPConnection then bossESPConnection:Disconnect() bossESPConnection = nil end end end) -- 大头娃娃 local bigHeadButton = mkBtn(visualFrame, "ToggleHeadEffect", "🤓大头娃娃山伯乐") local originalProperties = {} local isEffectApplied = false local function processZombies() for _, zombie in ipairs(workspace.Camera:GetDescendants()) do if zombie.Name == "m_Zombie" and zombie:FindFirstChild("Head") then local head = zombie.Head if isEffectApplied then if not originalProperties[zombie] then originalProperties[zombie] = {Size = head.Size, Transparency = head.Transparency} end head.Size = Vector3.new(4, 4, 4) head.Transparency = 0.5 else if originalProperties[zombie] then head.Size = originalProperties[zombie].Size head.Transparency = originalProperties[zombie].Transparency end end end end end bigHeadButton.MouseButton1Click:Connect(function() isEffectApplied = not isEffectApplied bigHeadButton.Text = isEffectApplied and "运行中" or "🤓大头娃娃山伯乐" setState(bigHeadButton, isEffectApplied) processZombies() end) workspace.Camera.DescendantAdded:Connect(function(d) if d.Name == "m_Zombie" and d:FindFirstChild("Head") then if isEffectApplied then local head = d.Head originalProperties[d] = {Size = head.Size, Transparency = head.Transparency} head.Size = Vector3.new(4, 4, 4) head.Transparency = 0.5 end end end) game:GetService("Players").LocalPlayer.CharacterRemoving:Connect(function() isEffectApplied = false processZombies() table.clear(originalProperties) end) -- ============================================================ -- 自动化分类 -- ============================================================ local autoFrame = CATS[5].Frame -- 自动挖雪 local autoDigButton = mkBtn(autoFrame, "AutoDigSnow", "自动挖雪: 关闭") local isAutoDigging = false local digConnection = nil local DIGGABLE_PATHS = { "Vardohus Fortress/Modes/Objective/DoorSnow/Diggable", "Vardohus Fortress/Modes/Objective/Diggable", "OLD Vardohus Fortress/Modes/Objective/DigSnow/Diggable" } local function getDiggingTool() local character = game:GetService("Players").LocalPlayer.Character if not character then return nil end for _, tool in pairs(character:GetChildren()) do if (tool.Name == "Shovel" or tool.Name == "Spade") and tool:FindFirstChild("RemoteEvent") then return tool end end for _, tool in pairs(game:GetService("Players").LocalPlayer.Backpack:GetChildren()) do if (tool.Name == "Shovel" or tool.Name == "Spade") and tool:FindFirstChild("RemoteEvent") then return tool end end return nil end local function findValidDiggable() for _, path in ipairs(DIGGABLE_PATHS) do local parts = path:split("/") local current = workspace for _, partName in ipairs(parts) do current = current:FindFirstChild(partName) if not current then break end end if current then return current end end return nil end local function executeDig() if not isAutoDigging then return end local diggable = findValidDiggable() if not diggable then return end local tool = getDiggingTool() if not tool then return end if tool.Parent ~= game:GetService("Players").LocalPlayer.Character then tool.Parent = game:GetService("Players").LocalPlayer.Character task.wait(0.2) end local remoteEvent = tool:FindFirstChild("RemoteEvent") if not remoteEvent then return end remoteEvent:FireServer("Dig", diggable, diggable.Position) end local function autoDigLoop() while isAutoDigging do executeDig() task.wait(0.01) end end autoDigButton.MouseButton1Click:Connect(function() isAutoDigging = not isAutoDigging setState(autoDigButton, isAutoDigging) autoDigButton.Text = isAutoDigging and "自动挖雪: 开启" or "自动挖雪: 关闭" if isAutoDigging then digConnection = task.spawn(autoDigLoop) else if digConnection then task.cancel(digConnection) digConnection = nil end end end) game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function() if isAutoDigging then isAutoDigging = false setState(autoDigButton, false) autoDigButton.Text = "自动挖雪: 关闭" if digConnection then task.cancel(digConnection) digConnection = nil end end end) -- 自动修复建筑 local autorepairButton = mkBtn(autoFrame, "AutorepairButton", "自动修复建筑") local repairOthersButton = mkSub(autoFrame, "修复他人建筑: 关闭") local AutorepairT = false local RepairOthersT = false local autorepairConnection = nil local function FindAndRepairNearestBuilding(includeOthers) local localPlayer = game:GetService("Players").LocalPlayer local workspaceSvc = game:GetService("Workspace") local camera = workspaceSvc.CurrentCamera local character = localPlayer.Character if not character then return end local playerId = tostring(localPlayer.UserId) local buildingsFolder = workspaceSvc:FindFirstChild("Buildings") if not buildingsFolder then return end local minDistance = math.huge local nearestBuildingHealth = nil local screenCenterX = camera.ViewportSize.X / 2 local screenCenterY = camera.ViewportSize.Y / 2 local function checkAndSetNearest(model) local bh = model:FindFirstChild("BuildingHealth") if bh then local hitbox = model:FindFirstChild("Hitbox") if hitbox then local sp, on = camera:WorldToScreenPoint(hitbox.CFrame.Position) if on then local d = (Vector2.new(sp.X, sp.Y) - Vector2.new(screenCenterX, screenCenterY)).Magnitude if d < minDistance then minDistance = d nearestBuildingHealth = bh end end end end end local pf = buildingsFolder:FindFirstChild(playerId) if pf then for _, model in ipairs(pf:GetChildren()) do if model:IsA("Model") then checkAndSetNearest(model) end end end if includeOthers then for _, folder in ipairs(buildingsFolder:GetChildren()) do if folder:IsA("Folder") and folder.Name ~= playerId then for _, model in ipairs(folder:GetChildren()) do if model:IsA("Model") then checkAndSetNearest(model) end end end end end local caltrops = workspaceSvc:FindFirstChild("Caltrops") if caltrops and caltrops:IsA("Model") then checkAndSetNearest(caltrops) end local stakes = workspaceSvc:FindFirstChild("Stakes") if stakes then checkAndSetNearest(stakes) end if nearestBuildingHealth then local hammer = character:FindFirstChild("Hammer") if hammer then local re = hammer:FindFirstChild("RemoteEvent") if re then re:FireServer("Repair", nearestBuildingHealth) end end end end autorepairButton.MouseButton1Click:Connect(function() AutorepairT = not AutorepairT setState(autorepairButton, AutorepairT) autorepairButton.Text = AutorepairT and "自动修复建筑: 开启" or "自动修复建筑: 关闭" repairOthersButton.Visible = AutorepairT if AutorepairT then autorepairConnection = task.spawn(function() while AutorepairT and task.wait(0.01) do FindAndRepairNearestBuilding(RepairOthersT) end end) else if autorepairConnection then task.cancel(autorepairConnection) autorepairConnection = nil end end end) repairOthersButton.MouseButton1Click:Connect(function() RepairOthersT = not RepairOthersT repairOthersButton.Text = "修复他人建筑: " .. (RepairOthersT and "开启" or "关闭") repairOthersButton.BackgroundColor3 = RepairOthersT and C.active or C.sub end) Players.LocalPlayer.CharacterAdded:Connect(function() if AutorepairT then AutorepairT = false; RepairOthersT = false setState(autorepairButton, false) autorepairButton.Text = "自动修复建筑" repairOthersButton.Visible = false if autorepairConnection then task.cancel(autorepairConnection) autorepairConnection = nil end end end) -- 自动修桥 local repairButton = mkBtn(autoFrame, "AutoRepairNearest", "自动修桥") local repairing = false local repairConnection local function getNearestConstruct() local char = player.Character if not char or not char:FindFirstChild("HumanoidRootPart") then return end local root = char.HumanoidRootPart local bridge = workspace:WaitForChild("Berezina"):WaitForChild("Modes"):WaitForChild("Holdout"):WaitForChild("Bridge") local nearest, dist = nil, math.huge for _, section in ipairs(bridge:GetChildren()) do local posts = section:FindFirstChild("Posts") if posts then for _, part in ipairs(posts:GetChildren()) do if part:IsA("BasePart") and part:FindFirstChild("ConstructHealth") then local d = (part.Position - root.Position).Magnitude if d < dist then dist = d nearest = part.ConstructHealth end end end end local beam = section:FindFirstChild("Beam") if beam and beam:FindFirstChild("ConstructHealth") then local d = (beam.Position - root.Position).Magnitude if d < dist then dist = d nearest = beam.ConstructHealth end end for _, joists in ipairs(section:GetChildren()) do if joists.Name == "Joists" and joists:FindFirstChild("ConstructHealth") then local d = (joists.Position - root.Position).Magnitude if d < dist then dist = d nearest = joists.ConstructHealth end end end end return nearest end local function doRepair() local target = getNearestConstruct() if not target then return end local hammer = player.Backpack:FindFirstChild("Hammer") or player.Backpack:FindFirstChild("Claw Hammer") if not hammer or not hammer:FindFirstChild("RemoteEvent") then return end hammer.RemoteEvent:FireServer("Repair", target) end repairButton.MouseButton1Click:Connect(function() repairing = not repairing setState(repairButton, repairing) if repairing then repairConnection = game:GetService("RunService").Heartbeat:Connect(function() doRepair() end) else if repairConnection then repairConnection:Disconnect() repairConnection = nil end end end) -- 自动拿木头 local autoLogButton = mkBtn(autoFrame, "AutoLogButton", "自动拿木头") local autoLogEnabled = false local autoLogConnection = nil autoLogButton.MouseButton1Click:Connect(function() autoLogEnabled = not autoLogEnabled setState(autoLogButton, autoLogEnabled) if autoLogEnabled then autoLogConnection = task.spawn(function() while autoLogEnabled and task.wait(0.01) do local re = workspace:FindFirstChild("Berezina") and workspace.Berezina:FindFirstChild("Modes") and workspace.Berezina.Modes:FindFirstChild("Holdout") and workspace.Berezina.Modes.Holdout:FindFirstChild("Log") and workspace.Berezina.Modes.Holdout.Log:FindFirstChild("Log") and workspace.Berezina.Modes.Holdout.Log.Log:FindFirstChild("Interact") if re and re:IsA("RemoteEvent") then pcall(function() re:FireServer() end) end end end) else if autoLogConnection then task.cancel(autoLogConnection) autoLogConnection = nil end end end) player.CharacterAdded:Connect(function() if autoLogEnabled then autoLogEnabled = false setState(autoLogButton, false) if autoLogConnection then task.cancel(autoLogConnection) autoLogConnection = nil end end end) -- 自动放置木头 local autoInteractButton = mkBtn(autoFrame, "AutoInteractButton", "自动放置木头") local autoInteractEnabled = false local autoInteractConnection = nil autoInteractButton.MouseButton1Click:Connect(function() autoInteractEnabled = not autoInteractEnabled setState(autoInteractButton, autoInteractEnabled) if autoInteractEnabled then autoInteractConnection = task.spawn(function() while autoInteractEnabled and task.wait(0.01) do for _, prompt in pairs(workspace:GetDescendants()) do if prompt:IsA("ProximityPrompt") and prompt.Name == "PlaceLogProximityPrompt" then pcall(function() fireproximityprompt(prompt) end) end end end end) else if autoInteractConnection then task.cancel(autoInteractConnection) autoInteractConnection = nil end end end) player.CharacterAdded:Connect(function() if autoInteractEnabled then autoInteractEnabled = false setState(autoInteractButton, false) if autoInteractConnection then task.cancel(autoInteractConnection) autoInteractConnection = nil end end end) -- Kaub自动收集 local kaubCollectButton = mkBtn(autoFrame, "KaubAutoCollect", "Kaub自动收集") local isKaubCollecting = false local kaubConnection = nil local activePrompts = {} local function setupKaubAutoCollect() local kaubFolder = workspace:FindFirstChild("Kaub") if not kaubFolder then warn("66压根没在卡布地图你用个几把") return end for _, descendant in ipairs(workspace:GetDescendants()) do if descendant:IsA("ProximityPrompt") then activePrompts[descendant] = true end end local dac = workspace.DescendantAdded:Connect(function(descendant) if descendant:IsA("ProximityPrompt") then activePrompts[descendant] = true end end) kaubConnection = game:GetService("RunService").Heartbeat:Connect(function() if not isKaubCollecting or not player.Character then return end local hrp = player.Character:FindFirstChild("HumanoidRootPart") if not hrp then return end for prompt, _ in pairs(activePrompts) do if prompt and prompt.Parent and prompt:IsA("ProximityPrompt") and prompt.Enabled then local part = prompt.Parent if part:IsA("BasePart") then local d = (part.Position - hrp.Position).Magnitude if d <= prompt.MaxActivationDistance then fireproximityprompt(prompt) end end else activePrompts[prompt] = nil end end end) return dac end kaubCollectButton.MouseButton1Click:Connect(function() isKaubCollecting = not isKaubCollecting setState(kaubCollectButton, isKaubCollecting) if isKaubCollecting then local dac = setupKaubAutoCollect() kaubCollectButton.DescendantAddedConn = dac else if kaubConnection then kaubConnection:Disconnect() kaubConnection = nil end if kaubCollectButton.DescendantAddedConn then kaubCollectButton.DescendantAddedConn:Disconnect() kaubCollectButton.DescendantAddedConn = nil end activePrompts = {} end end) player.CharacterAdded:Connect(function() if isKaubCollecting then isKaubCollecting = false setState(kaubCollectButton, false) if kaubConnection then kaubConnection:Disconnect() kaubConnection = nil end if kaubCollectButton.DescendantAddedConn then kaubCollectButton.DescendantAddedConn:Disconnect() kaubCollectButton.DescendantAddedConn = nil end activePrompts = {} end end) -- ============================================================ -- 移动分类 -- ============================================================ local moveFrame = CATS[6].Frame -- 保持速度 local speedButton = mkBtn(moveFrame, "SpeedControlButton", "保持速度: 关闭") local speedInput = Instance.new("TextBox") speedInput.Name = "SpeedInput" speedInput.Size = UDim2.new(1, -8, 0, 32) speedInput.BackgroundColor3 = C.sub speedInput.Text = "16" speedInput.PlaceholderText = "输入速度(1-100)" speedInput.TextColor3 = C.text speedInput.Font = Enum.Font.Gotham speedInput.TextSize = 13 speedInput.Parent = moveFrame corner(speedInput, 6) local isSpeedActive = false local DEFAULT_SPEED = 16 local function applySpeed() local speed = tonumber(speedInput.Text) or DEFAULT_SPEED speed = math.clamp(math.floor(speed), 1, 100) speedInput.Text = tostring(speed) if player.Character then local humanoid = player.Character:FindFirstChildOfClass("Humanoid") if humanoid then humanoid.WalkSpeed = isSpeedActive and speed or DEFAULT_SPEED end end end speedButton.MouseButton1Click:Connect(function() isSpeedActive = not isSpeedActive setState(speedButton, isSpeedActive) speedButton.Text = isSpeedActive and "保持速度: 开启" or "保持速度: 关闭" applySpeed() end) speedInput.FocusLost:Connect(function() applySpeed() end) player.CharacterAdded:Connect(function(character) local humanoid = character:WaitForChild("Humanoid") humanoid.WalkSpeed = isSpeedActive and (tonumber(speedInput.Text) or DEFAULT_SPEED) or DEFAULT_SPEED end) applySpeed() -- 移除摔伤 local noFallDamageButton = mkBtn(moveFrame, "NoFallDamageButton", "移除摔伤: 关闭") local noFallDamageActive = false local fallDamageConnection = nil local noFallDamageData = {Instance = noFallDamageButton, IsActive = false, Tracks = {}, Connections = {}} self.ActiveButtons["移除摔伤"] = noFallDamageData local function preventFallDamage() while noFallDamageActive and task.wait(1) do if not player.Character then continue end local health = player.Character:FindFirstChild("Health") if not health then continue end local forceSelfDamage = health:FindFirstChild("ForceSelfDamage") if not forceSelfDamage then continue end forceSelfDamage:FireServer(0) end end noFallDamageButton.MouseButton1Click:Connect(function() noFallDamageActive = not noFallDamageActive setState(noFallDamageButton, noFallDamageActive) noFallDamageButton.Text = noFallDamageActive and "移除摔伤: 开启" or "移除摔伤: 关闭" if noFallDamageActive then fallDamageConnection = task.spawn(preventFallDamage) else if fallDamageConnection then task.cancel(fallDamageConnection) fallDamageConnection = nil end end end) player.CharacterAdded:Connect(function() if noFallDamageActive then noFallDamageActive = false setState(noFallDamageButton, false) noFallDamageButton.Text = "移除摔伤: 关闭" if fallDamageConnection then task.cancel(fallDamageConnection) fallDamageConnection = nil end end end) -- 无减速 local noSlowButton = mkBtn(moveFrame, "NoSlow", "无减速") local noSlowData = {Instance = noSlowButton, IsActive = false, Tracks = {}, Connections = {}} self.ActiveButtons["NoSlow"] = noSlowData local noSlowActive = false local walkSpeedConnection = nil local characterAddedConnection = nil local function setupNoSlow() if not AnimationController.Character then return end local humanoid = AnimationController.Character:FindFirstChildOfClass("Humanoid") if not humanoid then return end if walkSpeedConnection then walkSpeedConnection:Disconnect() walkSpeedConnection = nil end walkSpeedConnection = humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function() if noSlowActive and humanoid.WalkSpeed < 16 then humanoid.WalkSpeed = 16 end end) if noSlowActive and humanoid.WalkSpeed < 16 then humanoid.WalkSpeed = 16 end end noSlowButton.MouseButton1Click:Connect(function() noSlowActive = not noSlowActive setState(noSlowButton, noSlowActive) if noSlowActive then setupNoSlow() if characterAddedConnection then characterAddedConnection:Disconnect() end characterAddedConnection = player.CharacterAdded:Connect(function() task.wait(1); setupNoSlow() end) else if walkSpeedConnection then walkSpeedConnection:Disconnect() walkSpeedConnection = nil end if characterAddedConnection then characterAddedConnection:Disconnect() characterAddedConnection = nil end end end) if AnimationController.Character then setupNoSlow() end game:GetService("Players").PlayerRemoving:Connect(function(leavingPlayer) if leavingPlayer == player then if walkSpeedConnection then walkSpeedConnection:Disconnect() end if characterAddedConnection then characterAddedConnection:Disconnect() end end end) -- ============================================================ -- 其他分类 -- ============================================================ local otherFrame = CATS[7].Frame -- 莱比锡绕过大门 local tpLeipzigBtn = mkBtn(otherFrame, "TeleportButton", "莱比锡绕过大门") tpLeipzigBtn.MouseButton1Click:Connect(function() local character = player.Character if character then local hrp = character:FindFirstChild("HumanoidRootPart") if hrp then hrp.CFrame = CFrame.new( -588.658203, 10.9199705, -109.468513, 0.258864343, 0, -0.965913713, 0, 1, 0, 0.965913713, 0, 0.258864343) end end end) -- 无敌飞雷神 local godTpBtn = mkBtn(otherFrame, "GodModeTeleport", "无敌飞雷神") local SAFE_DISTANCE = 3 local FLOAT_HEIGHT = 3 local FLOAT_SPEED = 15 local COOLDOWN = 0.6 local isGodTpActive = false local currentTarget = nil local floatOffset = 0 local lastSwitch = 0 local heartbeatConnection = nil local function getValidTargets() local targets = {} local me = game:GetService("Players").LocalPlayer for _, p in ipairs(game:GetService("Players"):GetPlayers()) do if p ~= me and p.Character and p.Character:FindFirstChild("HumanoidRootPart") and (not me.Team or not p.Team or p.Team ~= me.Team) then table.insert(targets, p) end end return targets end local function godTeleport() local me = game:GetService("Players").LocalPlayer if not me.Character then return end local myRoot = me.Character:FindFirstChild("HumanoidRootPart") if not myRoot then return end local targets = getValidTargets() if #targets == 0 then godTpBtn.Text = "无有效目标" task.wait(2) godTpBtn.Text = isGodTpActive and "停止传送" or "无敌飞雷神" return end if tick() - lastSwitch >= COOLDOWN then currentTarget = targets[math.random(1, #targets)] lastSwitch = tick() floatOffset = 0 end if currentTarget and currentTarget.Character then local targetRoot = currentTarget.Character:FindFirstChild("HumanoidRootPart") if targetRoot then floatOffset = math.sin(tick() * FLOAT_SPEED) * FLOAT_HEIGHT local backVector = targetRoot.CFrame.LookVector * -SAFE_DISTANCE local floatVector = Vector3.new(0, floatOffset, 0) myRoot.CFrame = CFrame.new(targetRoot.Position + backVector + floatVector, targetRoot.Position + floatVector) end end end local function stopGodTeleport() isGodTpActive = false if heartbeatConnection then heartbeatConnection:Disconnect() heartbeatConnection = nil end godTpBtn.Text = "无敌飞雷神" setState(godTpBtn, false) currentTarget = nil end godTpBtn.MouseButton1Click:Connect(function() isGodTpActive = not isGodTpActive if isGodTpActive then godTpBtn.Text = "停止传送" setState(godTpBtn, true) godTpBtn.BackgroundColor3 = C.danger currentTarget = nil lastSwitch = 0 heartbeatConnection = game:GetService("RunService").Heartbeat:Connect(function() if isGodTpActive then godTeleport() end end) else stopGodTeleport() end end) game:GetService("Players").LocalPlayer.CharacterAdded:Connect(function(newCharacter) stopGodTeleport() local humanoid = newCharacter:WaitForChild("Humanoid") humanoid.Died:Connect(function() stopGodTeleport() end) end) -- 黑皮体育生沉淀 local animLoopButton = mkBtn(otherFrame, "AnimationLoopButton", "黑皮体育生沉淀") local ANIMATION1 = "rbxassetid://127516132968916" local ANIMATION2 = "rbxassetid://126160671215200" local isAnimLooping = false local animLoopConnection = nil local currentTracks = {} local function playAnimationSequence(p) local character = p.Character or p.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid) local anim1 = Instance.new("Animation"); anim1.AnimationId = ANIMATION1 local anim2 = Instance.new("Animation"); anim2.AnimationId = ANIMATION2 while isAnimLooping do for _, track in pairs(currentTracks) do if track then track:Stop() end end currentTracks = {} local track1 = animator:LoadAnimation(anim1) table.insert(currentTracks, track1) track1:Play() task.wait(0.1) track1:Stop() if not isAnimLooping then break end local track2 = animator:LoadAnimation(anim2) table.insert(currentTracks, track2) track2:Play() task.wait(0.15) track2:Stop() end for _, track in pairs(currentTracks) do if track then track:Stop() end end currentTracks = {} end animLoopButton.MouseButton1Click:Connect(function() isAnimLooping = not isAnimLooping setState(animLoopButton, isAnimLooping) animLoopButton.Text = isAnimLooping and "黑皮体育生沉淀: 开启" or "黑皮体育生沉淀" if isAnimLooping then animLoopConnection = task.spawn(function() playAnimationSequence(Players.LocalPlayer) end) else if animLoopConnection then task.cancel(animLoopConnection) animLoopConnection = nil end for _, track in pairs(currentTracks) do if track then track:Stop() end end currentTracks = {} end end) Players.LocalPlayer.CharacterAdded:Connect(function() if isAnimLooping then isAnimLooping = false setState(animLoopButton, false) animLoopButton.Text = "黑皮体育生沉淀" if animLoopConnection then task.cancel(animLoopConnection) animLoopConnection = nil end for _, track in pairs(currentTracks) do if track then track:Stop() end end currentTracks = {} end end) -- 外部脚本 local loadOldGuardBtn = mkBtn(otherFrame, "LoadOldGuard", "老近卫(临时)") loadOldGuardBtn.MouseButton1Click:Connect(function() local success, err = pcall(function() loadstring(game:HttpGet("https://pastefy.app/Z8ViYhme/raw"))() end) if success then loadOldGuardBtn.Text = "Script Loaded" loadOldGuardBtn.BackgroundColor3 = Color3.fromRGB(0, 200, 0) else loadOldGuardBtn.Text = "Error Loading Script" loadOldGuardBtn.BackgroundColor3 = Color3.fromRGB(200, 0, 0) warn("", err) end task.delay(2, function() loadOldGuardBtn.Text = "老近卫(临时)" loadOldGuardBtn.BackgroundColor3 = C.btn end) end) local loadColdstreamBtn = mkBtn(otherFrame, "LoadColdstream", "临时冷溪") loadColdstreamBtn.MouseButton1Click:Connect(function() local success, err = pcall(function() loadstring(game:HttpGet("https://pastefy.app/CWGtJMQ7/raw"))() end) if success then loadColdstreamBtn.Text = "Script Loaded" loadColdstreamBtn.BackgroundColor3 = Color3.fromRGB(0, 200, 0) else loadColdstreamBtn.Text = "Error Loading Script" loadColdstreamBtn.BackgroundColor3 = Color3.fromRGB(200, 0, 0) warn("", err) end task.delay(2, function() loadColdstreamBtn.Text = "临时冷溪" loadColdstreamBtn.BackgroundColor3 = C.btn end) end) -- ============================================================ -- 分类切换 -- ============================================================ local sidebarButtons = {} local function switchCategory(idx) for i, cat in ipairs(CATS) do cat.Frame.Visible = (i == idx) end for i, b in ipairs(sidebarButtons) do if i == idx then b.BackgroundColor3 = C.active b.TextColor3 = Color3.fromRGB(255, 255, 255) else b.BackgroundColor3 = C.bgL b.TextColor3 = C.dim end end end for i, cat in ipairs(CATS) do local b = Instance.new("TextButton") b.Size = UDim2.new(1, -8, 0, 40) b.BackgroundColor3 = C.bgL b.BorderSizePixel = 0 b.Text = " " .. cat.icon .. " " .. cat.name b.TextColor3 = C.dim b.TextXAlignment = Enum.TextXAlignment.Left b.Font = Enum.Font.GothamMedium b.TextSize = 13 b.LayoutOrder = i b.AutoButtonColor = false b.Parent = sidebar corner(b, 8) b.MouseButton1Click:Connect(function() switchCategory(i) end) table.insert(sidebarButtons, b) end switchCategory(1) -- ============================================================ -- 面板开关 + 拖动 -- ============================================================ local isOpen = false local function togglePanel() isOpen = not isOpen panel.Visible = isOpen end local dragging, dragStart, startPos, clickTime = false, nil, nil, 0 circle.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = circle.Position clickTime = tick() input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) UserInputService.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - dragStart circle.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end) circle.MouseButton1Click:Connect(function() if tick() - clickTime > 0.3 then return end togglePanel() end) circle.MouseEnter:Connect(function() game:GetService("TweenService"):Create(circle, TweenInfo.new(0.15), {BackgroundColor3 = C.activeH}):Play() end) circle.MouseLeave:Connect(function() game:GetService("TweenService"):Create(circle, TweenInfo.new(0.15), {BackgroundColor3 = C.active}):Play() end) closeBtn.MouseButton1Click:Connect(togglePanel) local pDrag, pStart, pStartPos = false, nil, nil titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then pDrag = true pStart = input.Position pStartPos = panel.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then pDrag = false end end) end end) UserInputService.InputChanged:Connect(function(input) if pDrag and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - pStart panel.Position = UDim2.new(pStartPos.X.Scale, pStartPos.X.Offset + delta.X, pStartPos.Y.Scale, pStartPos.Y.Offset + delta.Y) end end) end