local WasUI = loadstring(game:HttpGet("https://raw.githubusercontent.com/WasKKal/WasUI-For-Roblox/main/WasUI.lua", true))() -- 创建配置文件夹 必须先调用 local cfg = WasUI:CreateFolder("WasUI_示例配置") -- 创建窗口 标题为 WasUI 示例 背景链接为 nil 雪花飘落开启 local mainWindow = WasUI:CreateWindow("WasUI 示例", nil, nil, nil, true) mainWindow:SetWelcome("欢迎使用 WasUI") -- 设置收起按钮的文字 mainWindow:SetMinimizedText("TrashHub") -- 设置关闭确认对话框的文本 WasUI.DialogTitle = "确认关闭 WasUI 示例?" -- 设置UI设置中文字与复制的内容 WasUI:SetGroupButtonText("加入 WasUI 主群") WasUI:SetGroupCopyContent("此处输入你的群号") local tabBasic = mainWindow:AddTab("基础") local tabGame = mainWindow:AddTab("游戏") local tabOld = mainWindow:AddTab("旧版演示") local tabNew = mainWindow:AddTab("新功能") WasUI:CreateCategory(tabBasic, "基础控件") -- 按钮示例 WasUI:CreateButton(tabBasic, "点击按钮", function() WasUI:Notify({Title = "按钮点击", Content = "按钮被点击了", Duration = 2}) end) -- 开关示例 绑定彩虹文字和配置保存 最后一个参数为 configKey WasUI:CreateToggleWithTitle(tabBasic, "彩虹开关 - 演示", false, function(state) WasUI:Notify({Title = "开关状态", Content = state and "演示开关已开启" or "演示开关已关闭", Duration = 2}) end, "演示开关", "我是彩虹文字", nil, "demo_toggle") -- 第二个开关 绑定不同的彩虹文字和配置键 WasUI:CreateToggleWithTitle(tabBasic, "无限跳", false, function(enabled) getgenv().InfJ = enabled game:GetService("UserInputService").JumpRequest:connect(function() if InfJ == true then game:GetService("Players").LocalPlayer.Character:FindFirstChildOfClass("Humanoid"):ChangeState("Jumping") end end) end) -- 第三个开关 配置键 WasUI:CreateToggleWithTitle(tabBasic, "穿墙", false, function(enabled) local workspace = game:GetService("Workspace") local Players = game:GetService("Players") if enabled then Clipon = true else Clipon = false end Stepped = game:GetService("RunService").Stepped:Connect(function() if Clipon then for _, child in pairs(workspace:GetChildren()) do if child.Name == Players.LocalPlayer.Name then for _, part in pairs(workspace[Players.LocalPlayer.Name]:GetChildren()) do if part:IsA("BasePart") then part.CanCollide = false end end end end else Stepped:Disconnect() end end) end) -- 下拉菜单示例 支持配置保存 WasUI:CreateDropdown(tabBasic, "下拉菜单演示", {"选项 A", "选项 B", "选项 C"}, "选项 A", function(selected) WasUI:Notify({Title = "下拉选择", Content = "选中:" .. selected, Duration = 2}) end, false, "demo_dropdown") -- 滑块示例 支持配置保存 WasUI:CreateSlider(tabBasic, "滑块演示", 0, 100, 50, function(value) WasUI:Notify({Title = "滑块数值", Content = "当前值:" .. value, Duration = 1}) end, "demo_slider") WasUI:CreateCategory(tabGame, "游戏功能") WasUI:CreateToggleWithTitle(tabGame, "静默自瞄", false, function(state) loadstring(game:HttpGet("https://raw.githubusercontent.com/odhdshhe/bu/refs/heads/main/%E6%9C%88%E4%BA%AE%E5%8A%A0%E5%AF%86%E8%BF%87%E7%9A%84%E6%9E%97%E7%9A%84%E8%87%AA%E7%9E%84.lua"))() WasUI:Notify({Title = "静默自瞄", Content = state and "静默自瞄已开启" or "静默自瞄无法关闭", Duration = 2}) end, nil, "静默自瞄", nil, "inf_stamina") WasUI:CreateToggleWithTitle(tabGame, "子弹追中", false, function(state) loadstring(game:HttpGet("https://raw.githubusercontent.com/ylt410/roblox-Script/refs/heads/main/子追"))() WasUI:Notify({Title = "子弹追中", Content = state and "子弹追中已开启" or "子弹追中无法关闭", Duration = 2}) end, nil, "子弹追中", nil, "inf_stamina") WasUI:CreateToggleWithTitle(tabGame, "死亡笔记", false, function(state) loadstring(game:HttpGet("https://raw.githubusercontent.com/xiaopi77/xiaopi77/main/1_1.txt_2024-08-08_153358.OTed.lua"))() end) WasUI:CreateToggleWithTitle(tabGame, "透视功能", false, function(state) loadstring(game:HttpGet("https://pastebin.com/raw/G2zb992X"))() end) WasUI:CreateToggleWithTitle(tabGame, "卡服脚本", false, function(state) loadstring(game:HttpGet("https://raw.githubusercontent.com/ylt410/roblox-Script/refs/heads/main/卡服.lua"))() end) WasUI:CreateToggleWithTitle(tabGame, "玩家传送到老外身边", false, function(state) loadstring(game:HttpGet("https://raw.githubusercontent.com/Infinity2346/Tect-Menu/main/Teleport%20Gui.lua"))() end) WasUI:CreateToggleWithTitle(tabGame, "吸人", false, function(state) loadstring(game:HttpGet("https://pastefy.app/fF3DMBNF/raw"))() end) WasUI:CreateToggleWithTitle(tabGame, "最强战场[服务器]", false, function(state) loadstring(game:HttpGet("https://raw.githubusercontent.com/ylt410/roblox-Script/refs/heads/main/最强战场"))() end) WasUI:CreateToggleWithTitle(tabGame, "人物飞天", false, function(state) loadstring(game:HttpGet("https://pastebin.com/raw/0DjWRXBY"))() end) -- 滑块调节 配置保存 WasUI:CreateSlider(tabGame, "行走速度调节", 16, 150, 50, function(value) local char = game.Players.LocalPlayer.Character if char and char:FindFirstChild("Humanoid") then char.Humanoid.WalkSpeed = value WasUI:Notify({Title = "行走速度", Content = "行走速度已设为 " .. value, Duration = 1}) end end, "walk_speed") WasUI:CreateSlider(tabGame, "跳跃高度调节", 50, 300, 100, function(value) local char = game.Players.LocalPlayer.Character if char and char:FindFirstChild("Humanoid") then char.Humanoid.JumpPower = value WasUI:Notify({Title = "跳跃高度", Content = "跳跃高度已设为 " .. value, Duration = 1}) end end, "jump_power") -- 下拉菜单示例 配置保存 WasUI:CreateDropdown(tabGame, "选择游戏模式", { "生存模式", "创造模式", "冒险模式", "旁观者模式" }, "生存模式", function(selected) WasUI:Notify({Title = "游戏模式", Content = "已切换到:" .. selected, Duration = 2}) end, false, "game_mode") -- 重置按钮 WasUI:CreateButton(tabGame, "重置角色状态", function() local char = game.Players.LocalPlayer.Character if char and char:FindFirstChild("Humanoid") then char.Humanoid.WalkSpeed = 16 char.Humanoid.JumpPower = 100 WasUI:Notify({Title = "重置", Content = "角色状态已重置", Duration = 2}) end end) WasUI:CreateCategory(tabOld, "动态下拉菜单 - 玩家列表") local playerDropdown = nil local refreshButton = WasUI:CreateButton(tabOld, "刷新玩家列表", function() local players = game:GetService("Players"):GetPlayers() local playerNames = {} for _, player in ipairs(players) do table.insert(playerNames, player.Name) end if #playerNames == 0 then WasUI:Notify({Title = "提示", Content = "当前没有玩家", Duration = 2}) return end if playerDropdown then local currentSelected = playerDropdown.SelectedValue local newDefault = nil for _, name in ipairs(playerNames) do if name == currentSelected then newDefault = currentSelected break end end if not newDefault and #playerNames > 0 then newDefault = playerNames[1] end playerDropdown:UpdateOptions(playerNames, newDefault) end WasUI:Notify({Title = "刷新成功", Content = "已更新玩家列表,共 " .. #playerNames .. " 人", Duration = 2}) end) playerDropdown = WasUI:CreateDropdown(tabOld, "选择玩家", {}, "无", function(selected) if selected and selected ~= "无" then WasUI:Notify({Title = "选中玩家", Content = "你选择了:" .. selected, Duration = 2}) end end, false, "selected_player") WasUI:CreateLabel(tabOld, "提示:点击「刷新玩家列表」按钮,即可从游戏服务器获取当前所有在线玩家并更新下拉菜单。") WasUI:CreateLabel(tabOld, "你可以通过下拉菜单选择一个玩家,点击后会显示通知。") WasUI:CreateLabel(tabOld, "当有玩家加入或离开时,再次点击刷新即可更新列表。") WasUI:CreateCategory(tabNew, "颜色选择器") WasUI:CreateColorPickerButton( tabNew, "选择颜色", Color3.fromRGB(100, 150, 255), function(color, alpha) WasUI:Notify({ Title = "颜色已选择", Content = string.format("#%s (透明度: %.2f)", color:ToHex():upper(), alpha), Duration = 3 }) end, "demo_color" ) WasUI:CreateCategory(tabNew, "二次确认控件") -- 确认按钮示例 带输入框 修正参数顺序 size 传 nil 图标放在第6个参数 WasUI:CreateConfirmButton(tabNew, "删除文件", { title = "危险操作", titleColor = WasUI.CurrentTheme.Error, description = "您确定要删除所有文件吗?此操作不可恢复。", descriptionColor = WasUI.CurrentTheme.Text, showInput = true, inputPlaceholder = "请输入 YES 确认", inputDefault = "", confirmText = "确认删除", cancelText = "取消", onConfirm = function(inputValue) if inputValue == "YES" then WasUI:Notify({Title = "删除成功", Content = "所有文件已被删除", Duration = 3, BackgroundColor = WasUI.CurrentTheme.Success}) else WasUI:Notify({Title = "验证失败", Content = "输入内容不正确,操作已取消", Duration = 3, BackgroundColor = WasUI.CurrentTheme.Error}) end end, onCancel = function() WasUI:Notify({Title = "已取消", Content = "删除操作已取消", Duration = 2}) end }, nil, nil, "trash-2") -- 确认开关示例 开启时需要确认 WasUI:CreateConfirmToggle(tabNew, "危险开关", false, { title = "开启危险开关", titleColor = WasUI.CurrentTheme.Warning, description = "你确定要开启这个危险开关吗?", confirmText = "确认开启", cancelText = "取消", onConfirm = function() WasUI:Notify({Title = "开关状态", Content = "危险开关已开启", Duration = 2}) end, onCancel = function() WasUI:Notify({Title = "已取消", Content = "开启操作已取消", Duration = 2}) end }, function(state) if not state then WasUI:Notify({Title = "开关状态", Content = "危险开关已关闭", Duration = 2}) end end, "危险开关", nil, nil, "danger_toggle") WasUI:CreateCategory(tabNew, "手动配置操作") WasUI:CreateButton(tabNew, "保存所有配置", function() local config = cfg:GetConfig("user_settings") if config then config:Save() end WasUI:Notify({Title = "保存", Content = "当前配置已写入文件", Duration = 2}) end) WasUI:CreateButton(tabNew, "加载配置", function() local config = cfg:GetConfig("user_settings") if config then config:Load() end WasUI:Notify({Title = "加载", Content = "配置已从文件恢复", Duration = 2}) end) WasUI:CreateButton(tabNew, "删除配置文件", function() cfg:DeleteConfig("user_settings") WasUI:Notify({Title = "删除", Content = "配置文件已清除", Duration = 2}) end) -- 初始化通知 WasUI:Notify({Title = "初始化", Content = "WasUI 示例加载完成", Duration = 4})