Bestmmm22

Untitled

Aug 27th, 2025
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.58 KB | None | 0 0
  1. -- Simple Utility UI (Legal Use Only)
  2. -- Buat game kamu sendiri di Roblox Studio. Bukan untuk eksploit/cheat.
  3. -- Fitur: draggable, open/close, toggle on/off, slider radius + tombol +/- , persist on respawn.
  4. -- ====== CONFIG ======
  5. local INITIAL_RADIUS = 25
  6. local MIN_RADIUS = 5
  7. local MAX_RADIUS = 150
  8. local STEP = 5
  9. local HOTKEY_TOGGLE_UI = Enum.KeyCode.RightControl -- buka/tutup cepat
  10. -- ====== CORE ======
  11. local Players = game:GetService("Players")
  12. local UserInputService = game:GetService("UserInputService")
  13. local RunService = game:GetService("RunService")
  14. local TweenService = game:GetService("TweenService")
  15. local player = Players.LocalPlayer
  16. -- Buat ScreenGui
  17. local gui = Instance.new("ScreenGui")
  18. gui.Name = "SimpleUtilityUI"
  19. gui.IgnoreGuiInset = true
  20. gui.ResetOnSpawn = false
  21. gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  22. gui.Parent = player:WaitForChild("PlayerGui")
  23. -- Tombol kecil untuk buka saat UI ditutup/minimize
  24. local openBtn = Instance.new("TextButton")
  25. openBtn.Name = "OpenButton"
  26. openBtn.Size = UDim2.fromOffset(120, 36)
  27. openBtn.Position = UDim2.new(0, 16, 0, 16)
  28. openBtn.Text = "Open Panel"
  29. openBtn.Font = Enum.Font.GothamSemibold
  30. openBtn.TextSize = 16
  31. openBtn.BackgroundColor3 = Color3.fromRGB(40, 40, 45)
  32. openBtn.TextColor3 = Color3.fromRGB(240, 240, 240)
  33. openBtn.AutoButtonColor = true
  34. openBtn.Visible = false
  35. openBtn.Parent = gui
  36. -- Panel utama
  37. local panel = Instance.new("Frame")
  38. panel.Name = "MainPanel"
  39. panel.Size = UDim2.fromOffset(320, 210)
  40. panel.Position = UDim2.new(0, 60, 0, 60)
  41. panel.BackgroundColor3 = Color3.fromRGB(28, 28, 32)
  42. panel.BorderSizePixel = 0
  43. panel.Parent = gui
  44. local corner = Instance.new("UICorner", panel)
  45. corner.CornerRadius = UDim.new(0, 12)
  46. local shadow = Instance.new("ImageLabel")
  47. shadow.Name = "Shadow"
  48. shadow.BackgroundTransparency = 1
  49. shadow.Image = "rbxassetid://5028857084"
  50. shadow.ImageColor3 = Color3.fromRGB(0,0,0)
  51. shadow.ImageTransparency = 0.45
  52. shadow.ScaleType = Enum.ScaleType.Slice
  53. shadow.SliceCenter = Rect.new(24,24,276,276)
  54. shadow.Size = UDim2.new(1, 30, 1, 30)
  55. shadow.Position = UDim2.new(0, -15, 0, -15)
  56. shadow.ZIndex = 0
  57. shadow.Parent = panel
  58. -- Header (drag area)
  59. local header = Instance.new("Frame")
  60. header.Name = "Header"
  61. header.Size = UDim2.new(1, 0, 0, 40)
  62. header.BackgroundColor3 = Color3.fromRGB(38, 38, 44)
  63. header.BorderSizePixel = 0
  64. header.Parent = panel
  65. Instance.new("UICorner", header).CornerRadius = UDim.new(0, 12)
  66. local title = Instance.new("TextLabel")
  67. title.BackgroundTransparency = 1
  68. title.Text = "Utility Panel"
  69. title.Font = Enum.Font.GothamBold
  70. title.TextSize = 16
  71. title.TextColor3 = Color3.fromRGB(235, 235, 245)
  72. title.TextXAlignment = Enum.TextXAlignment.Left
  73. title.Size = UDim2.new(1, -120, 1, 0)
  74. title.Position = UDim2.new(0, 16, 0, 0)
  75. title.Parent = header
  76. -- Tombol Close & Minimize
  77. local closeBtn = Instance.new("TextButton")
  78. closeBtn.Text = "✕"
  79. closeBtn.Font = Enum.Font.GothamBold
  80. closeBtn.TextSize = 16
  81. closeBtn.TextColor3 = Color3.fromRGB(245,245,245)
  82. closeBtn.Size = UDim2.fromOffset(36, 28)
  83. closeBtn.Position = UDim2.new(1, -44, 0, 6)
  84. closeBtn.BackgroundColor3 = Color3.fromRGB(210, 65, 70)
  85. closeBtn.AutoButtonColor = true
  86. Instance.new("UICorner", closeBtn).CornerRadius = UDim.new(0, 8)
  87. closeBtn.Parent = header
  88. local minimizeBtn = Instance.new("TextButton")
  89. minimizeBtn.Text = "—"
  90. minimizeBtn.Font = Enum.Font.GothamBold
  91. minimizeBtn.TextSize = 16
  92. minimizeBtn.TextColor3 = Color3.fromRGB(245,245,245)
  93. minimizeBtn.Size = UDim2.fromOffset(36, 28)
  94. minimizeBtn.Position = UDim2.new(1, -84, 0, 6)
  95. minimizeBtn.BackgroundColor3 = Color3.fromRGB(90, 90, 95)
  96. minimizeBtn.AutoButtonColor = true
  97. Instance.new("UICorner", minimizeBtn).CornerRadius = UDim.new(0, 8)
  98. minimizeBtn.Parent = header
  99. -- Konten
  100. local content = Instance.new("Frame")
  101. content.Name = "Content"
  102. content.BackgroundTransparency = 1
  103. content.Position = UDim2.new(0, 16, 0, 56)
  104. content.Size = UDim2.new(1, -32, 1, -72)
  105. content.Parent = panel
  106. local uiList = Instance.new("UIListLayout", content)
  107. uiList.Padding = UDim.new(0, 10)
  108. -- Toggle ON/OFF
  109. local function makeSwitch(labelText)
  110.     local row = Instance.new("Frame")
  111.     row.BackgroundColor3 = Color3.fromRGB(36,36,42)
  112.     row.Size = UDim2.new(1, 0, 0, 42)
  113.     row.Parent = content
  114.     Instance.new("UICorner", row).CornerRadius = UDim.new(0, 10)
  115.     local lbl = Instance.new("TextLabel")
  116.     lbl.BackgroundTransparency = 1
  117.     lbl.Text = labelText
  118.     lbl.Font = Enum.Font.Gotham
  119.     lbl.TextSize = 14
  120.     lbl.TextColor3 = Color3.fromRGB(235,235,245)
  121.     lbl.TextXAlignment = Enum.TextXAlignment.Left
  122.     lbl.Size = UDim2.new(1, -80, 1, 0)
  123.     lbl.Position = UDim2.new(0, 12, 0, 0)
  124.     lbl.Parent = row
  125.     local btn = Instance.new("TextButton")
  126.     btn.Size = UDim2.fromOffset(64, 28)
  127.     btn.Position = UDim2.new(1, -74, 0.5, -14)
  128.     btn.Text = "OFF"
  129.     btn.Font = Enum.Font.GothamBold
  130.     btn.TextSize = 14
  131.     btn.TextColor3 = Color3.fromRGB(240,240,240)
  132.     btn.BackgroundColor3 = Color3.fromRGB(90, 90, 95)
  133.     btn.AutoButtonColor = true
  134.     Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 10)
  135.     btn.Parent = row
  136.     local state = false
  137.     local function setState(v)
  138.         state = v
  139.         btn.Text = v and "ON" or "OFF"
  140.         TweenService:Create(btn, TweenInfo.new(0.15), {
  141.             BackgroundColor3 = v and Color3.fromRGB(60, 150, 95) or Color3.fromRGB(90, 90, 95)
  142.         }):Play()
  143.     end
  144.     btn.MouseButton1Click:Connect(function()
  145.         setState(not state)
  146.     end)
  147.     return {
  148.         row = row,
  149.         get = function() return state end,
  150.         set = setState,
  151.         button = btn,
  152.     }
  153. end
  154. local switch = makeSwitch("Aktifkan Fitur")
  155. -- Slider Radius + +/-
  156. local sliderRow = Instance.new("Frame")
  157. sliderRow.BackgroundColor3 = Color3.fromRGB(36,36,42)
  158. sliderRow.Size = UDim2.new(1, 0, 0, 72)
  159. sliderRow.Parent = content
  160. Instance.new("UICorner", sliderRow).CornerRadius = UDim.new(0, 10)
  161. local radiusLabel = Instance.new("TextLabel")
  162. radiusLabel.BackgroundTransparency = 1
  163. radiusLabel.Text = "Radius"
  164. radiusLabel.Font = Enum.Font.Gotham
  165. radiusLabel.TextSize = 14
  166. radiusLabel.TextColor3 = Color3.fromRGB(235,235,245)
  167. radiusLabel.TextXAlignment = Enum.TextXAlignment.Left
  168. radiusLabel.Size = UDim2.new(1, -20, 0, 24)
  169. radiusLabel.Position = UDim2.new(0, 12, 0, 6)
  170. radiusLabel.Parent = sliderRow
  171. local valueLabel = Instance.new("TextLabel")
  172. valueLabel.BackgroundTransparency = 1
  173. valueLabel.Text = tostring(INITIAL_RADIUS)
  174. valueLabel.Font = Enum.Font.GothamBold
  175. valueLabel.TextSize = 14
  176. valueLabel.TextColor3 = Color3.fromRGB(235,235,245)
  177. valueLabel.TextXAlignment = Enum.TextXAlignment.Right
  178. valueLabel.Size = UDim2.new(1, -20, 0, 24)
  179. valueLabel.Position = UDim2.new(0, 12, 0, 6)
  180. valueLabel.Parent = sliderRow
  181. local bar = Instance.new("Frame")
  182. bar.BackgroundColor3 = Color3.fromRGB(55,55,62)
  183. bar.BorderSizePixel = 0
  184. bar.Position = UDim2.new(0, 12, 0, 38)
  185. bar.Size = UDim2.new(1, -24, 0, 8)
  186. bar.Parent = sliderRow
  187. Instance.new("UICorner", bar).CornerRadius = UDim.new(0, 6)
  188. local fill = Instance.new("Frame")
  189. fill.BackgroundColor3 = Color3.fromRGB(80,140,220)
  190. fill.BorderSizePixel = 0
  191. fill.Size = UDim2.new(0, 0, 1, 0)
  192. fill.Parent = bar
  193. Instance.new("UICorner", fill).CornerRadius = UDim.new(0, 6)
  194. local knob = Instance.new("Frame")
  195. knob.Size = UDim2.fromOffset(14, 14)
  196. knob.Position = UDim2.new(0, -7, 0.5, -7)
  197. knob.BackgroundColor3 = Color3.fromRGB(240,240,245)
  198. knob.Parent = bar
  199. Instance.new("UICorner", knob).CornerRadius = UDim.new(1, 0)
  200. local minusBtn = Instance.new("TextButton")
  201. minusBtn.Text = "−"
  202. minusBtn.Font = Enum.Font.GothamBold
  203. minusBtn.TextSize = 18
  204. minusBtn.TextColor3 = Color3.fromRGB(240,240,240)
  205. minusBtn.Size = UDim2.fromOffset(32, 26)
  206. minusBtn.Position = UDim2.new(0, 12, 1, -34)
  207. minusBtn.BackgroundColor3 = Color3.fromRGB(90, 90, 95)
  208. minusBtn.AutoButtonColor = true
  209. Instance.new("UICorner", minusBtn).CornerRadius = UDim.new(0, 8)
  210. minusBtn.Parent = sliderRow
  211. local plusBtn = minusBtn:Clone()
  212. plusBtn.Text = "+"
  213. plusBtn.Position = UDim2.new(0, 52, 1, -34)
  214. plusBtn.Parent = sliderRow
  215. local currentRadius = INITIAL_RADIUS
  216. local function setRadius(v)
  217.     v = math.clamp(math.floor(v + 0.5), MIN_RADIUS, MAX_RADIUS)
  218.     currentRadius = v
  219.     valueLabel.Text = tostring(v)
  220.     local pct = (v - MIN_RADIUS) / (MAX_RADIUS - MIN_RADIUS)
  221.     fill.Size = UDim2.new(pct, 0, 1, 0)
  222.     knob.Position = UDim2.new(pct, -7, 0.5, -7)
  223. end
  224. setRadius(INITIAL_RADIUS)
  225. local dragging = false
  226. bar.InputBegan:Connect(function(input)
  227.     if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  228.         dragging = true
  229.     end
  230. end)
  231. bar.InputEnded:Connect(function(input)
  232.     if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  233.         dragging = false
  234.     end
  235. end)
  236. UserInputService.InputChanged:Connect(function(input)
  237.     if dragging and input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  238.         local rel = (input.Position.X - bar.AbsolutePosition.X) / bar.AbsoluteSize.X
  239.         setRadius(MIN_RADIUS + rel * (MAX_RADIUS - MIN_RADIUS))
  240.     end
  241. end)
  242. minusBtn.MouseButton1Click:Connect(function()
  243.     setRadius(currentRadius - STEP)
  244. end)
  245. plusBtn.MouseButton1Click:Connect(function()
  246.     setRadius(currentRadius + STEP)
  247. end)
  248. -- Drag panel
  249. do
  250.     local draggingPanel = false
  251.     local dragStart, startPos
  252.     header.InputBegan:Connect(function(input)
  253.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  254.             draggingPanel = true
  255.             dragStart = input.Position
  256.             startPos = panel.Position
  257.         end
  258.     end)
  259.     header.InputEnded:Connect(function(input)
  260.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  261.             draggingPanel = false
  262.         end
  263.     end)
  264.     UserInputService.InputChanged:Connect(function(input)
  265.         if draggingPanel and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  266.             local delta = input.Position - dragStart
  267.             panel.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  268.         end
  269.     end)
  270. end
  271. -- Minimize / Close / Open
  272. local function setPanelVisible(v)
  273.     panel.Visible = v
  274.     openBtn.Visible = not v
  275. end
  276. minimizeBtn.MouseButton1Click:Connect(function()
  277.     setPanelVisible(false)
  278. end)
  279. closeBtn.MouseButton1Click:Connect(function()
  280.     setPanelVisible(false)
  281. end)
  282. openBtn.MouseButton1Click:Connect(function()
  283.     setPanelVisible(true)
  284. end)
  285. UserInputService.InputBegan:Connect(function(input, gpe)
  286.     if gpe then return end
  287.     if input.KeyCode == HOTKEY_TOGGLE_UI then
  288.         setPanelVisible(not panel.Visible)
  289.     end
  290. end)
  291. -- ====== TEMPAT LOGIKA KAMU ======
  292. -- Fungsi ini akan jalan setiap frame. Isi dengan hal yang legal untuk game kamu sendiri.
  293. -- Contoh: debug draw, highlight NPC dalam radius, trigger bunyi, dsb.
  294. local function onTick(enabled, radius)
  295.     -- Contoh dummy (aman): ubah judul saat aktif & tampilkan radius
  296.     if enabled then
  297.         title.Text = ("Utility Panel • ON • Radius: %d"):format(radius)
  298.     else
  299.         title.Text = "Utility Panel"
  300.     end
  301.     -- >>> TARUH LOGIKA LEGAL KAMU DI SINI <<<
  302.     -- Misalnya:
  303.     -- for _, npc in ipairs(workspace.NPCs:GetChildren()) do
  304.     --   local hrp = npc:FindFirstChild("HumanoidRootPart")
  305.     --   local myRoot = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
  306.     --   if hrp and myRoot then
  307.     --     local dist = (hrp.Position - myRoot.Position).Magnitude
  308.     --     if enabled and dist <= radius then
  309.     --       -- lakukan sesuatu yang fair (highlight, UI indikator, dsb)
  310.     --     end
  311.     --   end
  312.     -- end
  313. end
  314. -- Loop update
  315. RunService.RenderStepped:Connect(function()
  316.     onTick(switch.get(), currentRadius)
  317. end)
  318. -- Inisialisasi visual
  319. switch.set(false)
  320. setPanelVisible(true)
Advertisement
Add Comment
Please, Sign In to add comment