Quick actions

cmd+k|ctrl+k

Navigation

Languages

HoopzInfMag

Snippet info

Language

Lua

Visibility

public

Author

legacy-v1-16166

Created

2023-07-07T22:40:00.858002Z

Updated

2023-08-27T19:50:47.655592Z

local UIS = game:GetService("UserInputService")
local PS = game:GetService("Players")

local Player = PS.LocalPlayer

local Grabbing = false

UIS.InputBegan:Connect(function(Input, GPE)
    if not GPE and Input.KeyCode == Enum.KeyCode.X then
        Grabbing = not Grabbing
        
        while Grabbing and task.wait(0.1) do
            for _, Target in next, PS:GetPlayers() do
                if Target.Character ~= nil and Target.Character ~= nil and Target.Character:FindFirstChild("Basketball") ~= nil then
                    pcall(function()
                        Player.Character.Humanoid:EquipTool(Target.Character.Basketball)
                    end)
                end
            end
                
            for _, Obj in next, Workspace:GetChildren() do
                if Obj:IsA("Tool") and Obj:FindFirstChild("Ball") ~= nil then
                    pcall(function()
                        Player.Character.Humanoid:EquipTool(Obj)
                    end)
                end
            end
        end
    end
end)
INFO