local function k(k,J)local function g(g)local b=g.Parent local I=b:FindFirstChildWhichIsA("\072\117\109\097\110\111\105\100")if I then I:TakeDamage(J)k:Destroy()end end attachCollisionFunction(k,g)end

local function setupFallingObjectCollisions(object, damage)

    -- The collision function; must be declared in this scope as it needs reference to "object" and "damage" params
    local function onTouch(otherObject)
        local character = otherObject.Parent
        local humanoid = character:FindFirstChildWhichIsA("Humanoid")
        if humanoid then
            humanoid:TakeDamage(damage)
            object:Destroy()
        end
    end

    -- Attach the above function to the falling object
    attachCollisionFunction(object, onTouch)
end
