local run = game:GetService("RunService") local event = game:GetService("ReplicatedStorage"):WaitForChild("meleeEvent") local player = game.Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") local sphere = Instance.new("Part") sphere.Shape = Enum.PartType.Ball sphere.Size = Vector3.new(20, 20, 20) sphere.Anchored = true sphere.CanCollide = false sphere.Transparency = 0.6 sphere.Parent = workspace local screenGui = Instance.new("ScreenGui") screenGui.Name = "DraggableUI" screenGui.ResetOnSpawn = false screenGui.Parent = playerGui local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 250, 0, 100) frame.Position = UDim2.new(0.5, -125, 0.5, -50) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 30) frame.BorderSizePixel = 0 frame.Parent = screenGui frame.Active = true frame.Draggable = true local textBox = Instance.new("TextBox") textBox.Size = UDim2.new(0.8, 0, 0.4, 0) textBox.Position = UDim2.new(0.1, 0, 0.1, 0) textBox.PlaceholderText = "Radius" textBox.Text = "" textBox.TextScaled = true textBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50) textBox.TextColor3 = Color3.fromRGB(255, 255, 255) textBox.BorderSizePixel = 0 textBox.Parent = frame local button = Instance.new("TextButton") button.Size = UDim2.new(0.6, 0, 0.3, 0) button.Position = UDim2.new(0.2, 0, 0.6, 0) button.Text = "Sphere: False" button.TextScaled = true button.BackgroundColor3 = Color3.fromRGB(225,0,0) button.TextColor3 = Color3.fromRGB(255, 255, 255) button.BorderSizePixel = 0 button.Parent = frame local toggle = false -- Button functionality button.MouseButton1Click:Connect(function() toggle = not toggle if toggle == true then button.Text = "Sphere: True" button.BackgroundColor3 = Color3.fromRGB(128,255,0) else button.Text = "Sphere: False" button.BackgroundColor3 = Color3.fromRGB(225,0,0) end end) run.Heartbeat:Connect(function() if toggle == true then radius = tonumber(textBox.Text) sphere.Size = Vector3.new(radius * 2, radius * 2, radius * 2) sphere.Transparency = 0.6 local char = player.Character if char and char:FindFirstChild("HumanoidRootPart") then sphere.Position = char.HumanoidRootPart.Position local touching = workspace:GetPartBoundsInRadius(sphere.Position, radius) local playersFound = {} for i, v in ipairs(touching) do local parent = v.Parent if parent and parent:FindFirstChild("Humanoid") then local otherPlayer = game.Players:GetPlayerFromCharacter(parent) if otherPlayer and otherPlayer ~= player and playersFound[otherPlayer] == nil then table.insert(playersFound, otherPlayer) end end end if #playersFound > 0 then for _, targetPlayer in ipairs(playersFound) do print(targetPlayer.Name) event:FireServer(targetPlayer) end end end task.wait() else sphere.Transparency = 1 end end)