Advertisement
Me_Hker

Kill All v.2

May 1st, 2025
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.83 KB | Gaming | 0 0
  1. -- Get the player
  2. local player = game.Players.LocalPlayer
  3.  
  4. -- Create GUI
  5. local gui = Instance.new("ScreenGui", player.PlayerGui)
  6. gui.ResetOnSpawn = false
  7.  
  8. -- Create Frame
  9. local frame = Instance.new("Frame", gui)
  10. frame.Size = UDim2.new(0, 120, 0, 180)
  11. frame.Position = UDim2.new(0.5, -60, 0.5, -90)
  12. frame.BackgroundColor3 = Color3.fromRGB(125, 255, 255)
  13. frame.Active, frame.Draggable = true, true
  14.  
  15. -- Create Buttons/Inputs
  16. local function createButton(text, pos, color, parent, size)
  17.     local btn = Instance.new("TextButton", parent)
  18.     btn.Size = size or UDim2.new(0, 100, 0, 30)
  19.     btn.Position = pos
  20.     btn.BackgroundColor3 = color
  21.     btn.Text = text
  22.     btn.TextScaled = true
  23.     return btn
  24. end
  25.  
  26. local function createTextbox(pos, parent)
  27.     local box = Instance.new("TextBox", parent)
  28.     box.Size = UDim2.new(0, 100, 0, 30)
  29.     box.Position = pos
  30.     box.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  31.     box.PlaceholderText = "hp%"
  32.     box.Text = ""
  33.     box.TextScaled = true
  34.     return box
  35. end
  36.  
  37. -- UI Elements
  38. local inputBox = createTextbox(UDim2.new(0.5, -50, 0.3, 0), frame)
  39. local toggleButton = createButton("เปิด", UDim2.new(0.5, -50, 0.55, 0), Color3.fromRGB(255, 255, 255), frame)
  40. local minimizeButton = createButton("ย่อเมนู", UDim2.new(0.5, -50, 0.8, 0), Color3.fromRGB(255, 0, 0), frame)
  41. local openButton = createButton("เปิด", UDim2.new(0.02, 0, 0.02, 0), Color3.fromRGB(125, 255, 125), gui, UDim2.new(0, 50, 0, 30))
  42. openButton.Visible = false
  43.  
  44. -- Toggle loop logic
  45. local running = false
  46. toggleButton.MouseButton1Click:Connect(function()
  47.     running = not running
  48.     toggleButton.Text = running and "ปิด" or "เปิด"
  49.  
  50.     if running then
  51.         task.spawn(function()
  52.             while running do
  53.                 local inputValue = tonumber(inputBox.Text) or 0
  54.                 local threshold = (inputValue <= 0) and 0.9999 or (inputValue / 100)
  55.  
  56.                 sethiddenproperty(player, "SimulationRadius", math.huge)
  57.                 sethiddenproperty(player, "MaxSimulationRadius", math.huge)
  58.  
  59.                 for _, d in pairs(workspace:GetDescendants()) do
  60.                     if d:IsA("Humanoid") and d.Parent.Name ~= player.Name then
  61.                         if d.Health <= (d.MaxHealth * threshold) then
  62.                             d.Health = 0
  63.                         end
  64.                     end
  65.                 end
  66.                 task.wait(0.1)
  67.             end
  68.         end)
  69.     end
  70. end)
  71.  
  72. -- Minimize/Maximize
  73. minimizeButton.MouseButton1Click:Connect(function()
  74.     frame.Visible = false
  75.     openButton.Visible = true
  76. end)
  77.  
  78. openButton.MouseButton1Click:Connect(function()
  79.     frame.Visible = true
  80.     openButton.Visible = false
  81. end)
  82.  
  83. -- Drag support
  84. local function enableDragging(guiElement)
  85.     local dragging, dragInput, mousePos, framePos
  86.  
  87.     guiElement.InputBegan:Connect(function(input)
  88.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  89.             dragging = true
  90.             mousePos = input.Position
  91.             framePos = guiElement.Position
  92.  
  93.             input.Changed:Connect(function()
  94.                 if input.UserInputState == Enum.UserInputState.End then
  95.                     dragging = false
  96.                 end
  97.             end)
  98.         end
  99.     end)
  100.  
  101.     guiElement.InputChanged:Connect(function(input)
  102.         if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  103.             local delta = input.Position - mousePos
  104.             guiElement.Position = UDim2.new(
  105.                 framePos.X.Scale, framePos.X.Offset + delta.X,
  106.                 framePos.Y.Scale, framePos.Y.Offset + delta.Y
  107.             )
  108.         end
  109.     end)
  110. end
  111.  
  112. enableDragging(frame)
  113. enableDragging(openButton)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement