I did a little testing..
procedure OnPlayerSpeak(ID: byte; Text: string);
var
Dist: single;
begin
//function RayCast(P1X,P1Y,P2X,P2Y: Single; var Distance: Single;MaxDist: Integer): Boolean;
if RayCast(GetPlayerStat(1,'X') - 20,GetPlayerStat(1,'Y'),GetPlayerStat(1,'X'),GetPlayerStat(1,'Y'),Dist,10000) then Command('/say GOOD');
Command('/say ' + FloattoStr(Dist));
end;
And it seems when RayCast returns false, Dist is a number larger than 20. Wondering why..