Advertisement
Me_Hker

Kill All v.2

May 1st, 2025 (edited)
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.11 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.  
  55.                 sethiddenproperty(player, "SimulationRadius", math.huge)
  56.                 sethiddenproperty(player, "MaxSimulationRadius", math.huge)
  57.  
  58.                 for _, d in pairs(workspace:GetDescendants()) do
  59.                     if d:IsA("Humanoid") and d.Parent.Name ~= player.Name then
  60.                         if inputValue >= 100 then
  61.                             d.Health = 0
  62.                         elseif inputValue <= 0 then
  63.                             if d.Health < d.MaxHealth then
  64.                                 d.Health = 0
  65.                             end
  66.                         else
  67.                             if d.Health <= (d.MaxHealth * (inputValue / 100)) then
  68.                                 d.Health = 0
  69.                             end
  70.                         end
  71.                     end
  72.                 end
  73.  
  74.                 task.wait(0.1)
  75.             end
  76.         end)
  77.     end
  78. end)
  79.  
  80. -- Minimize/Maximize
  81. minimizeButton.MouseButton1Click:Connect(function()
  82.     frame.Visible = false
  83.     openButton.Visible = true
  84. end)
  85.  
  86. openButton.MouseButton1Click:Connect(function()
  87.     frame.Visible = true
  88.     openButton.Visible = false
  89. end)
  90.  
  91. -- Drag support
  92. local function enableDragging(guiElement)
  93.     local dragging, dragInput, mousePos, framePos
  94.  
  95.     guiElement.InputBegan:Connect(function(input)
  96.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  97.             dragging = true
  98.             mousePos = input.Position
  99.             framePos = guiElement.Position
  100.  
  101.             input.Changed:Connect(function()
  102.                 if input.UserInputState == Enum.UserInputState.End then
  103.                     dragging = false
  104.                 end
  105.             end)
  106.         end
  107.     end)
  108.  
  109.     guiElement.InputChanged:Connect(function(input)
  110.         if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  111.             local delta = input.Position - mousePos
  112.             guiElement.Position = UDim2.new(
  113.                 framePos.X.Scale, framePos.X.Offset + delta.X,
  114.                 framePos.Y.Scale, framePos.Y.Offset + delta.Y
  115.             )
  116.         end
  117.     end)
  118. end
  119.  
  120. enableDragging(frame)
  121. enableDragging(openButton)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement