If you have the reference to the Model then you can use QueryDescendants:
function getRandomPartInModel(model: Model): Part?
local parts = model:QueryDescendants("BasePart")
if #parts > 0 then
return parts[math.random(1, #parts)]
else
return nil
end
end