try this.
As far I know addEventHandlers don't support tables. Just one single element. Or you should have to use root and check in the function if the element is true.
function MarkerHit( thePlayer )
local model = getElementModel( thePlayer )
if model~= 29 or model~= 181 then
cancelEvent()
end
end
addEventHandler ( "onPickupHit", createPickup(2251.99, 2489.39, 10.99, 1, 25, 10000, 60), MarkerHit )
addEventHandler ( "onPickupHit", createPickup(2295.36, 2461.00, 1082, 0, 100, 10000, 60), MarkerHit )
or
local pickups = {[createPickup(2251.99, 2489.39, 10.99, 1, 25, 10000, 60)]=true,[createPickup(2295.36, 2461.00, 1082, 0, 100, 10000, 60)]=true}
addEventHandler ( "onPickupHit", root,
function ( thePlayer )
if pickups[source] then
local model = getElementModel( thePlayer )
if model~= 29 or model~= 181 then
cancelEvent()
end
end
end)