Thanks trinick! I've been messing around with it, and for some reason the end %point has the exactly same value as %start.
Here's my code:
else if(%client.power $= "Warp")
{
%player = %client.player;
%start = %player.getEyePoint(); //Starting point of the vector
%scaledEyeVector = vectorScale(%player.getEyeVector(), 100);
%end = vectorAdd(%start, %scaledEyeVector); //Ending point
%result = containerRayCast(%start, %end, $TypeMasks::ALL); //The raycast itself
%point = posFromRayCast(%result);
//Extracting the coordinates, so we can teleport the player there.
%xW = getWord(%point,0);
%yW = getWord(%point, 1);
%zW = getWord(%point, 2);
//Teleports player to those coordinates
%client.player.setTransform(%xW SPC %yW SPC %zW);
//So I can see what is going on ;-;
messageClient(%client, '',"start:" SPC %start);
messageClient(%client, '',"scaledEyeVector:" SPC %scaledEyeVector);
messageClient(%client, '',"end:" SPC %end);
messageClient(%client, '',"result:" SPC %result);
messageClient(%client, '',"point:" SPC %point);
}
I have no idea what I'm doing wrong. I'm going to continue messing around with it.
Edit: I think the solution is to teleport the player to %end, still really confused though.
Edit 2: Hahaha, no. %end is apparently "0 0 0".