you can limit it by using root and using if command actually so you can handle it in a single eventhandler
The nil error could possibly be because mark1 has not been created yet
example:
function markerHandler(hitElement, matchingDimension)
if(getElementType(hitElement) == "player") then
if(source == mark1) then
--codes here for mark1
end
if(source == mark2) then
--codes here for mark2
end
end
end
addEventHandler("onClientMarkerHit", root, markerHandler)