%raycast = containerRayCast(%start,%end,%mask,%ignore);
The raycast returns several things. If it doesn't hit anything of said mask, then it will return null, but if an
object of the same typemask as %mask, then it will return the object id, position, and the normal (possibly more, can't remember). I forget how the ignore argument works (it is optional, as it defaults to null); I can't remember if you put in a certain object, or a typemask.
Here is how you would fire a raycast from a player to where they are looking, searching for a brick:
%eyePoint = %client.player.getEyePoint();
%eyeVector = %client.player.getEyeVector();
%Range = vectorAdd(%eyePoint,vectorScale(%eyeVector,10));
%raycast = containerRayCast(%eyePoint,%Range,$TypeMasks::fxBrickObjectType);
Now to get the brick you could do this:
%obj = firstWord(%raycast);
is(isObject(%obj))
{
//Do stuff
}
You can also use these functions to get the normal and position from raycasts easily without using getWord:
posFromRaycast(%raycast)
normalFromRaycast(%raycast)