Blockland Forums > Modification Help
Getting an objects id by looking at it.
<< < (2/3) > >>
Pah1023:

--- Quote from: Nexus on July 17, 2011, 08:23:10 PM ---
--- Code: ---%target = containerRayCast(%cl.player.getEyePoint(), vectorAdd(vectorScale(vectorNormalize(%cl.player.getEyeVector()), 5), %cl.player.getEyePoint()), $typeMasks::playerObjectType).client;
--- End code ---

This gets the client that a player is looking at.

just replace .client; with .getid();

--- End quote ---

I tried it and it keeps getting my id not what i am looking at
Destiny/Zack0Wack0:

--- Quote from: Pah1023 on July 17, 2011, 09:46:45 PM ---I tried it and it keeps getting my id not what i am looking at

--- End quote ---

--- Code: ---%start = %player.getEyePoint();
%end = vectorAdd(%start,vectorScale(%player.getEyeVector(),15));
%ray = containerRayCast(%start,%end,$TypeMasks::All,%player);
%col = firstWord(%ray);

--- End code ---
otto-san:

--- Quote from: Pah1023 on July 17, 2011, 09:46:45 PM ---I tried it and it keeps getting my id not what i am looking at

--- End quote ---

--- Quote from: Nexus on July 17, 2011, 08:23:10 PM ---just replace .client; with .getid();

--- End quote ---

Warning - while you were reading a new reply has been posted. You may wish to review your post.

oh
Pah1023:

--- Quote from: Destiny/Zack0Wack0 on July 17, 2011, 09:54:45 PM ---
--- Code: ---%ray = containerRayCast(%player.getEyePoint(),vectorScale(%player.getEyeVector(),5),$TypeMasks::All,%player);
%col = firstWord(%ray);

--- End code ---

--- End quote ---
Thank you.
Edit
It doesnt aim accuratly
Destiny/Zack0Wack0:
Woops, sorry.

--- Code: ---%start = %player.getEyePoint();
%end = vectorAdd(%start,vectorScale(%player.getEyeVector(),15));
%ray = containerRayCast(%start,%end,$TypeMasks::All,%player);
%col = firstWord(%ray);

--- End code ---
Navigation
Message Index
Next page
Previous page

Go to full version