You don't need to make a second function to set the interior.
function Main ()
point1 = createMarker(812.59881591797, -4124.7998046875, 92.460250854492, "corona", 4, 0, 0, 0, 0)
obstacle1 = createObject(8171, 691.27099609375, -4124.7021484375, 91.771263122559, 90, 0, 90)
obstacle2 = createObject(8171, 934.40093994141, -4124.7021484375, 91.771263122559, 90, 0, 270)
setElementInterior ( obstacle1, 1)
setElementInterior ( obstacle2, 1)
addEventHandler ( "onClientMarkerHit", point1, MainFunction )
end
addEventHandler( "onClientResourceStart", resourceRoot, Main )
function MainFunction ( hitPlayer, matchingDimension )
vehicle = getPedOccupiedVehicle ( hitPlayer )
if hitPlayer ~= Me then return end
if source == point1 then
destroyElement( obstacle1)
destroyElement( obstacle2)
end
end