-- ========================= -- SERVICES -- ========================= local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local lp = Players.LocalPlayer -- ========================= -- LOAD RAYFIELD -- ========================= local Rayfield = loadstring(game:HttpGet("https://sirius.menu/rayfield"))() local Window = Rayfield:CreateWindow({ Name = "Click Ball Fling", LoadingTitle = "Click Ball", LoadingSubtitle = "Brookhaven", ConfigurationSaving = { Enabled = false } }) local MainTab = Window:CreateTab("Main", 4483362458) -- ========================= -- SETTINGS -- ========================= getgenv().Settings = { FlingPower = 2500, BallSize = 3, } -- ========================= -- UI TOGGLE (X BUTTON) -- ========================= local uiVisible = true MainTab:CreateButton({ Name = "✖ Hide UI", Callback = function() uiVisible = false Window:SetVisibility(false) end }) -- KEYBIND SHOW / HIDE UserInputService.InputBegan:Connect(function(i,gp) if gp then return end if i.KeyCode == Enum.KeyCode.RightShift then uiVisible = not uiVisible Window:SetVisibility(uiVisible) end end) -- ========================= -- CREATE TOOL -- ========================= local Tool = Instance.new("Tool") Tool.Name = "Click Ball" Tool.RequiresHandle = false Tool.Parent = lp.Backpack -- ========================= -- GET CLOSEST PLAYER -- ========================= local function getClosestPlayer() local closest, dist = nil, math.huge for _,plr in pairs(Players:GetPlayers()) do if plr ~= lp and plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then local mag = (plr.Character.HumanoidRootPart.Position - lp.Character.HumanoidRootPart.Position).Magnitude if mag < dist and mag < 20 then dist = mag closest = plr end end end return closest end -- ========================= -- SPAWN BALL + FLING -- ========================= local function flingTarget(target) if not target.Character then return end local hrp = target.Character:FindFirstChild("HumanoidRootPart") if not hrp then return end local ball = Instance.new("Part") ball.Shape = Enum.PartType.Ball ball.Size = Vector3.new(Settings.BallSize,Settings.BallSize,Settings.BallSize) ball.Material = Enum.Material.Neon ball.Color = Color3.fromRGB(255,0,0) ball.CanCollide = false ball.Massless = true ball.CFrame = hrp.CFrame ball.Parent = workspace local weld = Instance.new("WeldConstraint") weld.Part0 = ball weld.Part1 = hrp weld.Parent = ball local bv = Instance.new("BodyVelocity") bv.MaxForce = Vector3.new(1e9,1e9,1e9) bv.Velocity = lp.Character.HumanoidRootPart.CFrame.LookVector * Settings.FlingPower bv.Parent = hrp task.delay(0.3,function() bv:Destroy() ball:Destroy() end) end -- ========================= -- TOOL CLICK -- ========================= Tool.Activated:Connect(function() local target = getClosestPlayer() if target then flingTarget(target) end end) -- ========================= -- UI SETTINGS -- ========================= MainTab:CreateSlider({ Name = "Fling Power", Range = {500,5000}, Increment = 100, CurrentValue = Settings.FlingPower, Callback = function(v) Settings.FlingPower = v end }) MainTab:CreateSlider({ Name = "Ball Size", Range = {2,10}, Increment = 1, CurrentValue = Settings.BallSize, Callback = function(v) Settings.BallSize = v end }) MainTab:CreateButton({ Name = "Re-Add Tool", Callback = function() Tool.Parent = lp.Backpack end }) Rayfield:Notify({ Title = "Ready", Content = "Pegang tool, klik player. RightShift = Show/Hide UI", Duration = 4 })