Add this at the top of the script
local markerTable = {};
Replace this
themarker = createMarker ( m[1], m[2], m[3]-1, "cylinder", 2, 25, 205, 100, 150 )
with this
markerTable[#markerTable + 1] = createMarker ( m[1], m[2], m[3]-1, "cylinder", 2, 25, 205, 100, 150 )
and this
addEventHandler ( "onClientMarkerHit", resourceRoot, function(hitPlayer)
if ( hitPlayer == localPlayer ) and getElementType(hitPlayer) == "player" then
for i = 1, #markerTable do
if source == markerTable[i] then
local x, y, z = unpack(destination[i]);
setElementPosition(hitPlayer, x, y, z);
end
end
end
end);
--You should make sure that you have as many destinations as markers not to get errors, keep in minde this is a sipmle way around it can be done way better!