Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Simple Utility UI (Legal Use Only)
- -- Buat game kamu sendiri di Roblox Studio. Bukan untuk eksploit/cheat.
- -- Fitur: draggable, open/close, toggle on/off, slider radius + tombol +/- , persist on respawn.
- -- ====== CONFIG ======
- local INITIAL_RADIUS = 25
- local MIN_RADIUS = 5
- local MAX_RADIUS = 150
- local STEP = 5
- local HOTKEY_TOGGLE_UI = Enum.KeyCode.RightControl -- buka/tutup cepat
- -- ====== CORE ======
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local TweenService = game:GetService("TweenService")
- local player = Players.LocalPlayer
- -- Buat ScreenGui
- local gui = Instance.new("ScreenGui")
- gui.Name = "SimpleUtilityUI"
- gui.IgnoreGuiInset = true
- gui.ResetOnSpawn = false
- gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- gui.Parent = player:WaitForChild("PlayerGui")
- -- Tombol kecil untuk buka saat UI ditutup/minimize
- local openBtn = Instance.new("TextButton")
- openBtn.Name = "OpenButton"
- openBtn.Size = UDim2.fromOffset(120, 36)
- openBtn.Position = UDim2.new(0, 16, 0, 16)
- openBtn.Text = "Open Panel"
- openBtn.Font = Enum.Font.GothamSemibold
- openBtn.TextSize = 16
- openBtn.BackgroundColor3 = Color3.fromRGB(40, 40, 45)
- openBtn.TextColor3 = Color3.fromRGB(240, 240, 240)
- openBtn.AutoButtonColor = true
- openBtn.Visible = false
- openBtn.Parent = gui
- -- Panel utama
- local panel = Instance.new("Frame")
- panel.Name = "MainPanel"
- panel.Size = UDim2.fromOffset(320, 210)
- panel.Position = UDim2.new(0, 60, 0, 60)
- panel.BackgroundColor3 = Color3.fromRGB(28, 28, 32)
- panel.BorderSizePixel = 0
- panel.Parent = gui
- local corner = Instance.new("UICorner", panel)
- corner.CornerRadius = UDim.new(0, 12)
- local shadow = Instance.new("ImageLabel")
- shadow.Name = "Shadow"
- shadow.BackgroundTransparency = 1
- shadow.Image = "rbxassetid://5028857084"
- shadow.ImageColor3 = Color3.fromRGB(0,0,0)
- shadow.ImageTransparency = 0.45
- shadow.ScaleType = Enum.ScaleType.Slice
- shadow.SliceCenter = Rect.new(24,24,276,276)
- shadow.Size = UDim2.new(1, 30, 1, 30)
- shadow.Position = UDim2.new(0, -15, 0, -15)
- shadow.ZIndex = 0
- shadow.Parent = panel
- -- Header (drag area)
- local header = Instance.new("Frame")
- header.Name = "Header"
- header.Size = UDim2.new(1, 0, 0, 40)
- header.BackgroundColor3 = Color3.fromRGB(38, 38, 44)
- header.BorderSizePixel = 0
- header.Parent = panel
- Instance.new("UICorner", header).CornerRadius = UDim.new(0, 12)
- local title = Instance.new("TextLabel")
- title.BackgroundTransparency = 1
- title.Text = "Utility Panel"
- title.Font = Enum.Font.GothamBold
- title.TextSize = 16
- title.TextColor3 = Color3.fromRGB(235, 235, 245)
- title.TextXAlignment = Enum.TextXAlignment.Left
- title.Size = UDim2.new(1, -120, 1, 0)
- title.Position = UDim2.new(0, 16, 0, 0)
- title.Parent = header
- -- Tombol Close & Minimize
- local closeBtn = Instance.new("TextButton")
- closeBtn.Text = "✕"
- closeBtn.Font = Enum.Font.GothamBold
- closeBtn.TextSize = 16
- closeBtn.TextColor3 = Color3.fromRGB(245,245,245)
- closeBtn.Size = UDim2.fromOffset(36, 28)
- closeBtn.Position = UDim2.new(1, -44, 0, 6)
- closeBtn.BackgroundColor3 = Color3.fromRGB(210, 65, 70)
- closeBtn.AutoButtonColor = true
- Instance.new("UICorner", closeBtn).CornerRadius = UDim.new(0, 8)
- closeBtn.Parent = header
- local minimizeBtn = Instance.new("TextButton")
- minimizeBtn.Text = "—"
- minimizeBtn.Font = Enum.Font.GothamBold
- minimizeBtn.TextSize = 16
- minimizeBtn.TextColor3 = Color3.fromRGB(245,245,245)
- minimizeBtn.Size = UDim2.fromOffset(36, 28)
- minimizeBtn.Position = UDim2.new(1, -84, 0, 6)
- minimizeBtn.BackgroundColor3 = Color3.fromRGB(90, 90, 95)
- minimizeBtn.AutoButtonColor = true
- Instance.new("UICorner", minimizeBtn).CornerRadius = UDim.new(0, 8)
- minimizeBtn.Parent = header
- -- Konten
- local content = Instance.new("Frame")
- content.Name = "Content"
- content.BackgroundTransparency = 1
- content.Position = UDim2.new(0, 16, 0, 56)
- content.Size = UDim2.new(1, -32, 1, -72)
- content.Parent = panel
- local uiList = Instance.new("UIListLayout", content)
- uiList.Padding = UDim.new(0, 10)
- -- Toggle ON/OFF
- local function makeSwitch(labelText)
- local row = Instance.new("Frame")
- row.BackgroundColor3 = Color3.fromRGB(36,36,42)
- row.Size = UDim2.new(1, 0, 0, 42)
- row.Parent = content
- Instance.new("UICorner", row).CornerRadius = UDim.new(0, 10)
- local lbl = Instance.new("TextLabel")
- lbl.BackgroundTransparency = 1
- lbl.Text = labelText
- lbl.Font = Enum.Font.Gotham
- lbl.TextSize = 14
- lbl.TextColor3 = Color3.fromRGB(235,235,245)
- lbl.TextXAlignment = Enum.TextXAlignment.Left
- lbl.Size = UDim2.new(1, -80, 1, 0)
- lbl.Position = UDim2.new(0, 12, 0, 0)
- lbl.Parent = row
- local btn = Instance.new("TextButton")
- btn.Size = UDim2.fromOffset(64, 28)
- btn.Position = UDim2.new(1, -74, 0.5, -14)
- btn.Text = "OFF"
- btn.Font = Enum.Font.GothamBold
- btn.TextSize = 14
- btn.TextColor3 = Color3.fromRGB(240,240,240)
- btn.BackgroundColor3 = Color3.fromRGB(90, 90, 95)
- btn.AutoButtonColor = true
- Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 10)
- btn.Parent = row
- local state = false
- local function setState(v)
- state = v
- btn.Text = v and "ON" or "OFF"
- TweenService:Create(btn, TweenInfo.new(0.15), {
- BackgroundColor3 = v and Color3.fromRGB(60, 150, 95) or Color3.fromRGB(90, 90, 95)
- }):Play()
- end
- btn.MouseButton1Click:Connect(function()
- setState(not state)
- end)
- return {
- row = row,
- get = function() return state end,
- set = setState,
- button = btn,
- }
- end
- local switch = makeSwitch("Aktifkan Fitur")
- -- Slider Radius + +/-
- local sliderRow = Instance.new("Frame")
- sliderRow.BackgroundColor3 = Color3.fromRGB(36,36,42)
- sliderRow.Size = UDim2.new(1, 0, 0, 72)
- sliderRow.Parent = content
- Instance.new("UICorner", sliderRow).CornerRadius = UDim.new(0, 10)
- local radiusLabel = Instance.new("TextLabel")
- radiusLabel.BackgroundTransparency = 1
- radiusLabel.Text = "Radius"
- radiusLabel.Font = Enum.Font.Gotham
- radiusLabel.TextSize = 14
- radiusLabel.TextColor3 = Color3.fromRGB(235,235,245)
- radiusLabel.TextXAlignment = Enum.TextXAlignment.Left
- radiusLabel.Size = UDim2.new(1, -20, 0, 24)
- radiusLabel.Position = UDim2.new(0, 12, 0, 6)
- radiusLabel.Parent = sliderRow
- local valueLabel = Instance.new("TextLabel")
- valueLabel.BackgroundTransparency = 1
- valueLabel.Text = tostring(INITIAL_RADIUS)
- valueLabel.Font = Enum.Font.GothamBold
- valueLabel.TextSize = 14
- valueLabel.TextColor3 = Color3.fromRGB(235,235,245)
- valueLabel.TextXAlignment = Enum.TextXAlignment.Right
- valueLabel.Size = UDim2.new(1, -20, 0, 24)
- valueLabel.Position = UDim2.new(0, 12, 0, 6)
- valueLabel.Parent = sliderRow
- local bar = Instance.new("Frame")
- bar.BackgroundColor3 = Color3.fromRGB(55,55,62)
- bar.BorderSizePixel = 0
- bar.Position = UDim2.new(0, 12, 0, 38)
- bar.Size = UDim2.new(1, -24, 0, 8)
- bar.Parent = sliderRow
- Instance.new("UICorner", bar).CornerRadius = UDim.new(0, 6)
- local fill = Instance.new("Frame")
- fill.BackgroundColor3 = Color3.fromRGB(80,140,220)
- fill.BorderSizePixel = 0
- fill.Size = UDim2.new(0, 0, 1, 0)
- fill.Parent = bar
- Instance.new("UICorner", fill).CornerRadius = UDim.new(0, 6)
- local knob = Instance.new("Frame")
- knob.Size = UDim2.fromOffset(14, 14)
- knob.Position = UDim2.new(0, -7, 0.5, -7)
- knob.BackgroundColor3 = Color3.fromRGB(240,240,245)
- knob.Parent = bar
- Instance.new("UICorner", knob).CornerRadius = UDim.new(1, 0)
- local minusBtn = Instance.new("TextButton")
- minusBtn.Text = "−"
- minusBtn.Font = Enum.Font.GothamBold
- minusBtn.TextSize = 18
- minusBtn.TextColor3 = Color3.fromRGB(240,240,240)
- minusBtn.Size = UDim2.fromOffset(32, 26)
- minusBtn.Position = UDim2.new(0, 12, 1, -34)
- minusBtn.BackgroundColor3 = Color3.fromRGB(90, 90, 95)
- minusBtn.AutoButtonColor = true
- Instance.new("UICorner", minusBtn).CornerRadius = UDim.new(0, 8)
- minusBtn.Parent = sliderRow
- local plusBtn = minusBtn:Clone()
- plusBtn.Text = "+"
- plusBtn.Position = UDim2.new(0, 52, 1, -34)
- plusBtn.Parent = sliderRow
- local currentRadius = INITIAL_RADIUS
- local function setRadius(v)
- v = math.clamp(math.floor(v + 0.5), MIN_RADIUS, MAX_RADIUS)
- currentRadius = v
- valueLabel.Text = tostring(v)
- local pct = (v - MIN_RADIUS) / (MAX_RADIUS - MIN_RADIUS)
- fill.Size = UDim2.new(pct, 0, 1, 0)
- knob.Position = UDim2.new(pct, -7, 0.5, -7)
- end
- setRadius(INITIAL_RADIUS)
- local dragging = false
- bar.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- end
- end)
- bar.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = false
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
- local rel = (input.Position.X - bar.AbsolutePosition.X) / bar.AbsoluteSize.X
- setRadius(MIN_RADIUS + rel * (MAX_RADIUS - MIN_RADIUS))
- end
- end)
- minusBtn.MouseButton1Click:Connect(function()
- setRadius(currentRadius - STEP)
- end)
- plusBtn.MouseButton1Click:Connect(function()
- setRadius(currentRadius + STEP)
- end)
- -- Drag panel
- do
- local draggingPanel = false
- local dragStart, startPos
- header.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- draggingPanel = true
- dragStart = input.Position
- startPos = panel.Position
- end
- end)
- header.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- draggingPanel = false
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if draggingPanel and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
- local delta = input.Position - dragStart
- panel.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end)
- end
- -- Minimize / Close / Open
- local function setPanelVisible(v)
- panel.Visible = v
- openBtn.Visible = not v
- end
- minimizeBtn.MouseButton1Click:Connect(function()
- setPanelVisible(false)
- end)
- closeBtn.MouseButton1Click:Connect(function()
- setPanelVisible(false)
- end)
- openBtn.MouseButton1Click:Connect(function()
- setPanelVisible(true)
- end)
- UserInputService.InputBegan:Connect(function(input, gpe)
- if gpe then return end
- if input.KeyCode == HOTKEY_TOGGLE_UI then
- setPanelVisible(not panel.Visible)
- end
- end)
- -- ====== TEMPAT LOGIKA KAMU ======
- -- Fungsi ini akan jalan setiap frame. Isi dengan hal yang legal untuk game kamu sendiri.
- -- Contoh: debug draw, highlight NPC dalam radius, trigger bunyi, dsb.
- local function onTick(enabled, radius)
- -- Contoh dummy (aman): ubah judul saat aktif & tampilkan radius
- if enabled then
- title.Text = ("Utility Panel • ON • Radius: %d"):format(radius)
- else
- title.Text = "Utility Panel"
- end
- -- >>> TARUH LOGIKA LEGAL KAMU DI SINI <<<
- -- Misalnya:
- -- for _, npc in ipairs(workspace.NPCs:GetChildren()) do
- -- local hrp = npc:FindFirstChild("HumanoidRootPart")
- -- local myRoot = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
- -- if hrp and myRoot then
- -- local dist = (hrp.Position - myRoot.Position).Magnitude
- -- if enabled and dist <= radius then
- -- -- lakukan sesuatu yang fair (highlight, UI indikator, dsb)
- -- end
- -- end
- -- end
- end
- -- Loop update
- RunService.RenderStepped:Connect(function()
- onTick(switch.get(), currentRadius)
- end)
- -- Inisialisasi visual
- switch.set(false)
- setPanelVisible(true)
Advertisement
Add Comment
Please, Sign In to add comment