--[[ Xi Pro 终极战场【按钮不显示修复版】 修复:界面黑的/看不到按钮/看不到输入框 功能:最小化 + 全部按钮 + 输入框 + 开启提示 ]] -- 基础变量 local partsize = 1 local WallRange = 5 local WallConn = nil -- 清理旧UI pcall(function() if getgenv().NinjaGui then getgenv().NinjaGui:Destroy() end end) -- ============== 创建UI核心 ============== local NinjaGui = Instance.new("ScreenGui") NinjaGui.Name = "NinjaInjectGui" NinjaGui.ResetOnSpawn = false NinjaGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling getgenv().NinjaGui = NinjaGui NinjaGui.Parent = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui") -- 主窗口 local MainFrame = Instance.new("Frame") MainFrame.Name = "MainFrame" MainFrame.Size = UDim2.new(0, 350, 0, 500) MainFrame.Position = UDim2.new(0.02,0,0.1,0) MainFrame.BackgroundColor3 = Color3.new(0.06,0.06,0.12) MainFrame.BorderColor3 = Color3.new(0, 1, 1) MainFrame.BorderSizePixel = 2 MainFrame.ClipsDescendants = true MainFrame.Parent = NinjaGui -- 顶部标题栏 local TopBar = Instance.new("Frame") TopBar.Size = UDim2.new(1,0,0,30) TopBar.BackgroundColor3 = Color3.new(0,0.7,1) TopBar.Parent = MainFrame local Title = Instance.new("TextLabel") Title.Size = UDim2.new(0.85,0,1,0) Title.BackgroundTransparency = 1 Title.Text = "Xi Pro 终极战场【修复版】" Title.TextColor3 = Color3.new(1,1,1) Title.TextSize = 15 Title.Font = Enum.Font.SourceSansBold Title.Parent = TopBar -- 最小化按钮 local MinBtn = Instance.new("TextButton") MinBtn.Size = UDim2.new(0,32,0,24) MinBtn.Position = UDim2.new(1,-38,0,3) MinBtn.BackgroundColor3 = Color3.new(0.1,0.1,0.1) MinBtn.Text = "—" MinBtn.TextColor3 = Color3.new(1,1,1) MinBtn.Parent = TopBar -- 滚动容器【修复关键:CanvasSize已扩大】 local ScroFrame = Instance.new("ScrollingFrame") ScroFrame.Size = UDim2.new(1,-6,1,-35) ScroFrame.Position = UDim2.new(3,0,32,0) ScroFrame.BackgroundTransparency = 1 -- 修复:把滚动区域高度设为足够大,让所有按钮都能显示 ScroFrame.CanvasSize = UDim2.new(0, 0, 0, 750) ScroFrame.ScrollBarThickness = 4 ScroFrame.Parent = MainFrame -- 提示弹窗 local Tip = Instance.new("Frame") Tip.Size = UDim2.new(0,170,0,40) Tip.Position = UDim2.new(0.5,-85,0.9,0) Tip.BackgroundColor3 = Color3.new(0,1,1) Tip.Visible = false Tip.ZIndex = 10 Tip.Parent = NinjaGui local TipTxt = Instance.new("TextLabel") TipTxt.Size = UDim2.new(1,0,1,0) TipTxt.BackgroundTransparency = 1 TipTxt.Text = "开启成功!" TipTxt.TextColor3 = Color3.new(0,0,0) TipTxt.Parent = Tip -- ============== 最小化逻辑 ============== local IsMin = false local OldSize = MainFrame.Size MinBtn.MouseButton1Click:Connect(function() IsMin = not IsMin if IsMin then MainFrame.Size = UDim2.new(0,110,0,30) ScroFrame.Visible = false MinBtn.Text = "□" else MainFrame.Size = OldSize ScroFrame.Visible = true MinBtn.Text = "—" end end) -- 提示函数 local function ShowTips(msg) TipTxt.Text = msg.." 开启成功" Tip.Visible = true task.wait(0.8) Tip.Visible = false end -- ============== 开关变量 ============== local Toggle1,Toggle2,Toggle3,Toggle4,Toggle5,Toggle6,Toggle7 = false,false,false,false,false,false,false -- ============== 创建按钮通用【修复关键:改用像素位置,不使用百分比】 ============== local function NewBtn(name, yPixel, func) local Btn = Instance.new("TextButton") Btn.Size = UDim2.new(0.92, 0, 0, 30) Btn.Position = UDim2.new(0.04, 0, 0, yPixel) Btn.BackgroundColor3 = Color3.new(0.15,0.15,0.25) Btn.BorderColor3 = Color3.new(0,1,1) Btn.Text = name Btn.TextColor3 = Color3.new(1,1,1) Btn.Parent = ScroFrame Btn.MouseButton1Click:Connect(function() func() ShowTips(name) end) end -- ========== 全部功能按钮【位置已校准】 ========== NewBtn("贴墙攻击", 10, function() Toggle1 = not Toggle1 if WallConn then WallConn:Disconnect() WallConn = nil end if Toggle1 then WallConn = game:GetService("RunService").Heartbeat:Connect(function() local plr = game.Players.LocalPlayer local char = plr.Character if not char or not char:FindFirstChild("HumanoidRootPart") then return end local hrp = char.HumanoidRootPart local part = workspace:FindFirstChild("Map") and workspace.Map.Props.Walls.Break:FindFirstChild("Part") if not part then return end part.Size = Vector3.new(1, WallRange, WallRange) part.Transparency = 0.7 part.CFrame = hrp.CFrame * CFrame.new(0,0,-5) * CFrame.Angles(0,math.rad(90),0) end) end end) NewBtn("正面防御", 50, function() Toggle2 = not Toggle2 pcall(function() game.ReplicatedStorage.Remotes.Combat.Block:FireServer(Toggle2) end) end) NewBtn("攻击无间隔", 90, function() Toggle3 = not Toggle3 pcall(function() game.ReplicatedStorage.Settings.Cooldowns.Melee.Value = Toggle3 and 0 or 100 end) end) NewBtn("冲刺无间隔", 130, function() Toggle4 = not Toggle4 pcall(function() game.ReplicatedStorage.Settings.Cooldowns.Dash.Value = Toggle4 and 0 or 100 end) end) NewBtn("无布娃娃+无后摇", 170, function() Toggle5 = not Toggle5 if Toggle5 then _G.whwy = true task.spawn(function() while _G.whwy and task.wait() do pcall(function() local s = game.ReplicatedStorage.Settings s.Toggles.NoSlowdowns.Value = true s.Toggles.DisableHitStun.Value = true s.Multipliers.RagdollTimer.Value = 0 end) end end) else _G.whwy = false pcall(function() local s = game.ReplicatedStorage.Settings s.Toggles.NoSlowdowns.Value = false s.Toggles.DisableHitStun.Value = false s.Multipliers.RagdollTimer.Value = 100 end) end end) NewBtn("大招时间延长", 210, function() Toggle6 = not Toggle6 if Toggle6 then _G.bbb = true task.spawn(function() while _G.bbb and task.wait() do pcall(function() game.ReplicatedStorage.Settings.Multipliers.UltimateTimer.Value = 99999 end) end end) else _G.bbb = false pcall(function() game.ReplicatedStorage.Settings.Multipliers.UltimateTimer.Value = 100 end) end end) NewBtn("一拳超大伤害", 250, function() Toggle7 = not Toggle7 if Toggle7 then _G.aaa = true task.spawn(function() while _G.aaa and task.wait() do pcall(function() game.ReplicatedStorage.Settings.Multipliers.MeleeDamage.Value = 1000000 end) end end) else _G.aaa = false pcall(function() game.ReplicatedStorage.Settings.Multipliers.MeleeDamage.Value = 100 end) end end) -- ========== 三个输入框【位置已校准】 ========== local function MakeInput(name, yPixel) local F = Instance.new("Frame") F.Size = UDim2.new(0.92,0,0,36) F.Position = UDim2.new(0.04, 0, 0, yPixel) F.BackgroundColor3 = Color3.new(0.12,0.12,0.22) F.BorderColor3 = Color3.new(0,1,1) F.Parent = ScroFrame local L = Instance.new("TextLabel") L.Size = UDim2.new(0.42,0,1,0) L.BackgroundTransparency = 1 L.Text = name L.TextColor3 = Color3.new(1,1,1) L.Parent = F local B = Instance.new("TextBox") B.Size = UDim2.new(0.48,0,0.75,0) B.Position = UDim2.new(0.48,0,0.12,0) B.BackgroundColor3 = Color3.new(0.2,0.2,0.35) B.Text = "100" B.TextColor3 = Color3.new(1,1,1) B.Parent = F return B end local In1 = MakeInput("攻击速度", 300) local In2 = MakeInput("击退大小", 350) local In3 = MakeInput("冲刺速度", 400) -- 输入框绑定 In1.FocusLost:Connect(function(enter) if not enter then return end pcall(function() game.ReplicatedStorage.Settings.Multipliers.MeleeSpeed.Value = tonumber(In1.Text) or 100 ShowTips("攻击速度已设置") end) end) In2.FocusLost:Connect(function(enter) if not enter then return end pcall(function() game.ReplicatedStorage.Settings.Multipliers.RagdollPower.Value = tonumber(In2.Text) or 100 ShowTips("击退大小已设置") end) end) In3.FocusLost:Connect(function(enter) if not enter then return end pcall(function() game.ReplicatedStorage.Settings.Multipliers.DashSpeed.Value = tonumber(In3.Text) or 100 ShowTips("冲刺速度已设置") end) end) print("✅ 按钮/输入框显示修复版加载成功!")