Unlimited Pickup

Touch to Pickup


Click to Pickup


Unlimited Pickup

Touch Part

local part = script.Parent
local canGet = true

local function pickup(otherPart)
    local partParent = otherPart.Parent
    local humanoid = partParent:FindFirstChildWhichIsA('Humanoid')
    if humanoid and canGet then
        canGet = false
        local newTool = Instance.new('Tool')
        local handle = part:Clone()
        handle.Name = 'Handle'
        handle.Parent = newTool
        handle.Script:Destroy()
        newTool.Parent = partParent
        wait(3)
        canGet = true
    end
end 

part.Touched:Connect(pickup)
local part = script.Parent
local canGet = true

local function pickup(otherPart)
    local partParent = otherPart.Parent
    local humanoid = partParent:FindFirstChildWhichIsA('Humanoid')
    local inHand = partParent:FindFirstChildWhichIsA('Tool')
    local player = game.Players:FindFirstChild(partParent.Name)
    local inBackpack = player.Backpack:FindFirstChildWhichIsA('Tool')
    if humanoid and canGet and not (inHand or inBackpack) then
        canGet = false
        local newTool = Instance.new('Tool')
        newTool.Name = 'Coin'
        local handle = part:Clone()
        handle.Name = 'Handle'
        handle.Parent = newTool
        handle.Script:Destroy()
        newTool.Parent = partParent
        wait(3)
        canGet = true
    end
end

part.Touched:Connect(pickup)

Click Part

local part = script.Parent
local click = part.ClickDetector

local function pickup(player)
    local newTool = Instance.new('Tool')
    newTool.Name = 'Coin'
    local handle = part:Clone()
    handle.Name = 'Handle'
    handle.Parent = newTool
    handle.Script:Destroy()
    newTool.Parent = game.Workspace[player.Name]
end

click.MouseClick:Connect(pickup)
local part = script.Parent
local click = part.ClickDetector

local function pickup(player)
    local playerModel = game.Workspace:FindFirstChild(player.Name)
    local inHand = playerModel:FindFirstChild('Brick')
    local inBackpack = player.Backpack:FindFirstChild('Brick')
    if not (inHand or inBackpack) then
        local newTool = Instance.new('Tool')
        newTool.Name = 'Brick'
        local handle = part:Clone()
        handle.Name = 'Handle'
        handle.Parent = newTool
        handle.Script:Destroy()
        newTool.Parent = game.Workspace:FindFirstChild(player.Name)
    end
end

click.MouseClick:Connect(pickup)