This should help out a bit, try to understand what's going on.
//%this should be a player object
function getObjectInView(%this)
{
//shoot a raycast
%o = false;
%client = %this.client;
%eyeVector = %this.getEyeVector();
%eyePoint = %this.getEyePoint();
//range the raycast will go until it stops
%range = 100;
%rangeScale = VectorScale(%eyeVector, %range);
%rangeEnd = VectorAdd(%eyePoint, %rangeScale);
%raycast = containerRayCast(%eyePoint,%rangeEnd,$TypeMasks::FxBrickObjectType | $TypeMasks::FxBrickAlwaysObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::ItemObjectType , %this);
%o = getWord(%raycast,0);
return %o;
}