How to remove abilities and attachedObjects from players?

So I can list player abilities with player:GetAbilities and attached objects with player:GetAttachedObjects, but how do I remove elements? There is nothing in the API, but I assume there is a way to accomplish this with script?

Thanks

You can use the "Destroy()" method of CoreObjects to remove/delete objects. The code below is an example of how to use the "Destroy()" method but will not work because I did not define the "player" variable, I'll leave that up to you :slight_smile:.

function RemoveAttachedObjects()
    --delete all attached objects
    for _, coreObj in ipairs(player:GetAttachedObjects()) do
        coreObj:Destroy()
    end
    --delete all attached abilities
    for _, ability in ipairs(player:GetAbilities()) do
        ability:Destroy()
    end
end

CoreObject Documentation

perfect, thanks for your help