Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Get the player
- local player = game.Players.LocalPlayer
- -- Create GUI
- local gui = Instance.new("ScreenGui", player.PlayerGui)
- gui.ResetOnSpawn = false
- -- Create Frame
- local frame = Instance.new("Frame", gui)
- frame.Size = UDim2.new(0, 120, 0, 180) -- Adjusted size
- frame.Position = UDim2.new(0.5, -60, 0.5, -90)
- frame.BackgroundColor3 = Color3.fromRGB(125, 255, 255)
- frame.Active, frame.Draggable = true, true
- -- Create Buttons
- local function createButton(text, pos, color, parent, size)
- local btn = Instance.new("TextButton", parent)
- btn.Size = size or UDim2.new(0, 100, 0, 30) -- Default size if not specified
- btn.Position = pos
- btn.BackgroundColor3 = color
- btn.Text = text
- return btn
- end
- local spawnoneButton = createButton("เปิดฆ่ามอนทั้งแมพ(99%)", UDim2.new(0.5, -50, 0.3, 0), Color3.fromRGB(255, 255, 255), frame)
- local bossIslandButton = createButton("เปิดฆ่าเกาะบอส(99%)", UDim2.new(0.5, -50, 0.5, 0), Color3.fromRGB(255, 255, 255), frame)
- local minimizeButton = createButton("ย่อเมนู", UDim2.new(0.5, -50, 0.8, 0), Color3.fromRGB(255, 0, 0), frame)
- 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
- openButton.Visible = false
- -- Toggle for killing all monsters in the map
- local isSpawnOne = false
- spawnoneButton.MouseButton1Click:Connect(function()
- isSpawnOne = not isSpawnOne
- spawnoneButton.Text = isSpawnOne and "ปิดฆ่ามอนทั้งแมพ(99%)" or "เปิดฆ่ามอนทั้งแมพ(99%)"
- while isSpawnOne do
- local props = game.Players.LocalPlayer
- sethiddenproperty(props, "SimulationRadius", 1e10)
- sethiddenproperty(props, "MaxSimulationRadius", 1e10)
- for _, d in pairs(workspace:GetDescendants()) do
- if d:IsA("Humanoid") and not game.Players:GetPlayerFromCharacter(d.Parent) and d.Health / d.MaxHealth <= 0.99 then
- d.Health = 0
- end
- end
- wait(0.01)
- end
- end)
- -- Toggle for killing monsters on Boss Island
- local isBossIsland = false
- bossIslandButton.MouseButton1Click:Connect(function()
- isBossIsland = not isBossIsland
- bossIslandButton.Text = isBossIsland and "ปิดฆ่าเกาะบอส(99%)" or "เปิดฆ่าเกาะบอส(99%)"
- while isBossIsland do
- local props = game.Players.LocalPlayer
- sethiddenproperty(props, "SimulationRadius", 1e10)
- sethiddenproperty(props, "MaxSimulationRadius", 1e10)
- local regionMin = Vector3.new(913, 8, 120)
- local regionMax = Vector3.new(1048, 91, 272)
- local function isInRegion(position)
- return (position.X >= math.min(regionMin.X, regionMax.X) and position.X <= math.max(regionMin.X, regionMax.X)) and
- (position.Y >= math.min(regionMin.Y, regionMax.Y) and position.Y <= math.max(regionMin.Y, regionMax.Y)) and
- (position.Z >= math.min(regionMin.Z, regionMax.Z) and position.Z <= math.max(regionMin.Z, regionMax.Z))
- end
- for _, d in pairs(workspace:GetDescendants()) do
- if d:IsA("Humanoid") and not game.Players:GetPlayerFromCharacter(d.Parent) then
- local primaryPart = d.Parent:FindFirstChild("PrimaryPart") or d.Parent:FindFirstChild("HumanoidRootPart")
- if primaryPart and isInRegion(primaryPart.Position) and d.Health / d.MaxHealth <= 0.99 then
- d.Health = 0
- end
- end
- end
- wait(0.01)
- end
- end)
- -- Minimize and Maximize Functions
- minimizeButton.MouseButton1Click:Connect(function()
- frame.Visible = false
- openButton.Visible = true
- end)
- openButton.MouseButton1Click:Connect(function()
- frame.Visible = true
- openButton.Visible = false
- end)
- -- Drag Function
- local function enableDragging(guiElement)
- local dragging, dragInput, mousePos, framePos
- guiElement.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging, mousePos, framePos = true, input.Position, guiElement.Position
- input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end)
- end
- end)
- guiElement.InputChanged:Connect(function(input)
- if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
- local delta = input.Position - mousePos
- guiElement.Position = UDim2.new(framePos.X.Scale, framePos.X.Offset + delta.X, framePos.Y.Scale, framePos.Y.Offset + delta.Y)
- end
- end)
- end
- -- Enable dragging for both frame and openButton
- enableDragging(frame)
- enableDragging(openButton)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement