This function will return the y position (in room coordinates) of the point that you input for the path that you index. If the point is outside of the range of the path (ie: a path has 8 points and you ask for the y position of point 10) then a value of 0 will be returned.
|index||The index of the path to check.|
|n||The point identity to check.|
if path_position = 1
i = floor(random(path_get_number(mypath)));
x = path_get_point_x(mypath, i);
y = path_get_point_y(mypath, i);
path_position = (1 / path_get_number(mypath)) * i;
The above code will check to see if an instance is at the end of a path. If it is it will then choose a random point on the path and move the instance to that point.