local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local Workspace = game:GetService("Workspace") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui",10) local Character,HRP,Humanoid local function RefreshCharacter() Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait() HRP = Character:WaitForChild("HumanoidRootPart") Humanoid = Character:WaitForChild("Humanoid") end RefreshCharacter() LocalPlayer.CharacterAdded:Connect(RefreshCharacter) local autoDodge = false --==================== 开场动画 guest_hub ==================== local introGui = Instance.new("ScreenGui") introGui.Name = "guest_hub_Intro" introGui.IgnoreGuiInset = true introGui.ResetOnSpawn = false introGui.Parent = PlayerGui local bg = Instance.new("Frame") bg.Size = UDim2.new(1,0,1,0) bg.BackgroundColor3 = Color3.new(0.02,0.04,0.08) bg.Parent = introGui local titleText = Instance.new("TextLabel") titleText.Size = UDim2.new(1,0,0,120) titleText.Position = UDim2.new(0,0,0.35,0) titleText.BackgroundTransparency = 1 titleText.Text = "guest_hub" titleText.Font = Enum.Font.GothamBold titleText.TextSize = 48 titleText.TextColor3 = Color3.new(0.2,0.7,1) titleText.TextTransparency = 1 titleText.Parent = bg local subText = Instance.new("TextLabel") subText.Size = UDim2.new(1,0,0,40) subText.Position = UDim2.new(0,0,0.48,0) subText.BackgroundTransparency = 1 subText.Text = "地铁冲浪模块 已加载" subText.Font = Enum.Font.Gotham subText.TextSize = 22 subText.TextColor3 = Color3.new(0.8,0.8,0.8) subText.TextTransparency = 1 subText.Parent = bg local t1 = TweenService:Create(titleText, TweenInfo.new(1.2), {TextTransparency = 0}) local t2 = TweenService:Create(subText, TweenInfo.new(1.2), {TextTransparency = 0}) t1:Play() t2:Play() task.wait(2.5) local th1 = TweenService:Create(titleText, TweenInfo.new(0.8), {TextTransparency = 1}) local th2 = TweenService:Create(subText, TweenInfo.new(0.8), {TextTransparency = 1}) th1:Play() th2:Play() task.wait(0.9) introGui:Destroy() --==================== 主GUI 窗口居中,可拖动 ==================== local mainGui = Instance.new("ScreenGui") mainGui.Name = "guest_hub" mainGui.IgnoreGuiInset = true mainGui.ResetOnSpawn = false mainGui.Parent = PlayerGui local hubFrame = Instance.new("Frame") hubFrame.Name = "Hub" hubFrame.Size = UDim2.new(0,340,0,200) hubFrame.Position = UDim2.new(0.5,-170,0.5,-100) --窗口正中心 hubFrame.BackgroundColor3 = Color3.new(0.07,0.09,0.14) hubFrame.BorderSizePixel = 2 hubFrame.BorderColor3 = Color3.new(0.1,0.6,0.9) hubFrame.Visible = true hubFrame.Parent = mainGui --缩小按钮 local hideBtn = Instance.new("TextButton") hideBtn.Size = UDim2.new(0,32,0,32) hideBtn.Position = UDim2.new(0,4,0,2) hideBtn.BackgroundColor3 = Color3.new(0.1,0.6,0.9) hideBtn.Text = "-" hideBtn.TextColor3 = Color3.new(1,1,1) hideBtn.TextSize = 22 hideBtn.Font = Enum.Font.GothamBold hideBtn.Parent = hubFrame local hubTitle = Instance.new("TextLabel") hubTitle.Size = UDim2.new(0.8,0,0,32) hubTitle.Position = UDim2.new(0.1,0,0,0) hubTitle.BackgroundTransparency = 1 hubTitle.Text = "guest_hub | 地铁冲浪" hubTitle.Font = Enum.Font.GothamBold hubTitle.TextSize = 16 hubTitle.TextColor3 = Color3.new(0.3,0.75,1) hubTitle.Parent = hubFrame local content = Instance.new("Frame") content.Size = UDim2.new(0.92,0,0,120) content.Position = UDim2.new(0.04,0,0.08,0) content.BackgroundTransparency = 1 content.Parent = hubFrame --展开按钮固定在屏幕右上角 local showBtn = Instance.new("TextButton") showBtn.Size = UDim2.new(0,36,0,36) showBtn.Position = UDim2.new(0.96,0,0.02,0) showBtn.BackgroundColor3 = Color3.new(0.1,0.6,0.9) showBtn.Text = "+" showBtn.TextColor3 = Color3.new(1,1,1) showBtn.TextSize = 24 showBtn.Font = Enum.Font.GothamBold showBtn.Visible = false showBtn.Parent = mainGui local hubOpen = true local function ToggleHub() hubOpen = not hubOpen hubFrame.Visible = hubOpen showBtn.Visible = not hubOpen hideBtn.Text = hubOpen and "-" or "+" end hideBtn.Activated:Connect(ToggleHub) showBtn.Activated:Connect(ToggleHub) -- ====================== 全窗口拖拽 ====================== local dragging = false local dragStartPos local frameStartPos hubFrame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStartPos = input.Position frameStartPos = hubFrame.Position input:Capture() 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 - dragStartPos hubFrame.Position = UDim2.new( frameStartPos.X.Scale, frameStartPos.X.Offset + delta.X, frameStartPos.Y.Scale, frameStartPos.Y.Offset + delta.Y ) end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) -- ======================================================= --UI按钮:自动躲避障碍物 local function CreateToggle(parent,name,pos,callback) local btn = Instance.new("TextButton") btn.Size = UDim2.new(0.9,0,0,28) btn.Position = pos btn.BackgroundColor3 = Color3.new(0.13,0.15,0.22) btn.Text = name.." [OFF]" btn.TextColor3 = Color3.new(1,1,1) btn.TextSize = 12 local state = false btn.Activated:Connect(function() state = not state btn.Text = name.." ["..(state and "ON" or "OFF").."]" callback(state) end) btn.Parent = parent return btn end CreateToggle(content,"自动躲避障碍物",UDim2.new(0.05,0,0.01,0),function(enabled) autoDodge = enabled end) --自动躲避循环:把玩家传送到画面上方空中(你圈出来的位置) RunService.Heartbeat:Connect(function() if not autoDodge or not HRP then return end --保持人物在轨道上方高空,避开所有列车障碍物 local targetPos = HRP.Position + Vector3.new(0,28,0) HRP.CFrame = CFrame.new(targetPos) Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,false) end)