Advertisement
Me_Hker

Kill All

Feb 15th, 2025
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.95 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) -- Adjusted size
  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
  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) -- Default size if not specified
  19.     btn.Position = pos
  20.     btn.BackgroundColor3 = color
  21.     btn.Text = text
  22.     return btn
  23. end
  24.  
  25. local spawnoneButton = createButton("เปิดฆ่ามอนทั้งแมพ(99%)", UDim2.new(0.5, -50, 0.3, 0), Color3.fromRGB(255, 255, 255), frame)
  26. local bossIslandButton = createButton("เปิดฆ่าเกาะบอส(99%)", UDim2.new(0.5, -50, 0.5, 0), Color3.fromRGB(255, 255, 255), frame)
  27. local minimizeButton = createButton("ย่อเมนู", UDim2.new(0.5, -50, 0.8, 0), Color3.fromRGB(255, 0, 0), frame)
  28. local openButton = createButton("เปิด", UDim2.new(0.02, 0, 0.02, 0), Color3.fromRGB(125, 255, 125), gui, UDim2.new(0, 50, 0, 30)) -- Smaller size for open button
  29. openButton.Visible = false
  30.  
  31. -- Toggle for killing all monsters in the map
  32. local isSpawnOne = false
  33. spawnoneButton.MouseButton1Click:Connect(function()
  34.     isSpawnOne = not isSpawnOne
  35.     spawnoneButton.Text = isSpawnOne and "ปิดฆ่ามอนทั้งแมพ(99%)" or "เปิดฆ่ามอนทั้งแมพ(99%)"
  36.     while isSpawnOne do
  37.         local props = game.Players.LocalPlayer
  38.         sethiddenproperty(props, "SimulationRadius", 1e10)
  39.         sethiddenproperty(props, "MaxSimulationRadius", 1e10)
  40.  
  41.         for _, d in pairs(workspace:GetDescendants()) do
  42.             if d:IsA("Humanoid") and not game.Players:GetPlayerFromCharacter(d.Parent) and d.Health / d.MaxHealth <= 0.99 then
  43.                 d.Health = 0
  44.             end
  45.         end
  46.         wait(0.01)
  47.     end
  48. end)
  49.  
  50. -- Toggle for killing monsters on Boss Island
  51. local isBossIsland = false
  52. bossIslandButton.MouseButton1Click:Connect(function()
  53.     isBossIsland = not isBossIsland
  54.     bossIslandButton.Text = isBossIsland and "ปิดฆ่าเกาะบอส(99%)" or "เปิดฆ่าเกาะบอส(99%)"
  55.     while isBossIsland do
  56.         local props = game.Players.LocalPlayer
  57.         sethiddenproperty(props, "SimulationRadius", 1e10)
  58.         sethiddenproperty(props, "MaxSimulationRadius", 1e10)
  59.  
  60.         local regionMin = Vector3.new(913, 8, 120)
  61.         local regionMax = Vector3.new(1048, 91, 272)
  62.  
  63.         local function isInRegion(position)
  64.             return (position.X >= math.min(regionMin.X, regionMax.X) and position.X <= math.max(regionMin.X, regionMax.X)) and
  65.                    (position.Y >= math.min(regionMin.Y, regionMax.Y) and position.Y <= math.max(regionMin.Y, regionMax.Y)) and
  66.                    (position.Z >= math.min(regionMin.Z, regionMax.Z) and position.Z <= math.max(regionMin.Z, regionMax.Z))
  67.         end
  68.  
  69.         for _, d in pairs(workspace:GetDescendants()) do
  70.             if d:IsA("Humanoid") and not game.Players:GetPlayerFromCharacter(d.Parent) then
  71.                 local primaryPart = d.Parent:FindFirstChild("PrimaryPart") or d.Parent:FindFirstChild("HumanoidRootPart")
  72.                 if primaryPart and isInRegion(primaryPart.Position) and d.Health / d.MaxHealth <= 0.99 then
  73.                     d.Health = 0
  74.                 end
  75.             end
  76.         end
  77.         wait(0.01)
  78.     end
  79. end)
  80.  
  81. -- Minimize and Maximize Functions
  82. minimizeButton.MouseButton1Click:Connect(function()
  83.     frame.Visible = false
  84.     openButton.Visible = true
  85. end)
  86.  
  87. openButton.MouseButton1Click:Connect(function()
  88.     frame.Visible = true
  89.     openButton.Visible = false
  90. end)
  91.  
  92. -- Drag Function
  93. local function enableDragging(guiElement)
  94.     local dragging, dragInput, mousePos, framePos
  95.  
  96.     guiElement.InputBegan:Connect(function(input)
  97.         if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  98.             dragging, mousePos, framePos = true, input.Position, guiElement.Position
  99.             input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end)
  100.         end
  101.     end)
  102.  
  103.     guiElement.InputChanged:Connect(function(input)
  104.         if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  105.             local delta = input.Position - mousePos
  106.             guiElement.Position = UDim2.new(framePos.X.Scale, framePos.X.Offset + delta.X, framePos.Y.Scale, framePos.Y.Offset + delta.Y)
  107.         end
  108.     end)
  109. end
  110.  
  111. -- Enable dragging for both frame and openButton
  112. enableDragging(frame)
  113. enableDragging(openButton)
Tags: Script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement