Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 [TorqueScript] I Require help.

Go down 
AuthorMessage
[TGR]Devvy
TG Captain
TG Captain
[TGR]Devvy


Posts : 498
Reputation : 10
Join date : 2009-11-22
Age : 27
Location : A deep cavern on Uranus.... Heheh... *Cough choke*

[TorqueScript] I Require help. Empty
PostSubject: [TorqueScript] I Require help.   [TorqueScript] I Require help. EmptyThu Feb 11, 2010 6:50 pm

Hey everyone. Anyone here know TorqueScript? (.cs)

I'm trying to get this aimbot to work, But all that happens is the camera just spins round when i press the lock on key. Any help?

Code:
if(!$ClientAim::Binds) {
   $remapDivision[$remapCount]="ClientAim";
   $remapName[$remapCount]="Lock-On";
   $remapCmd[$remapCount]="ClientAim_Lock";
   $remapName[$remapCount++]="Cancel";
   $remapCmd[$remapCount]="ClientAim_Cancel";
   $remapCount++;
   $ClientAim::Binds=1;
}
function ClientAim_Lock(%val,%tick) {
   if(%tick) {
      if(!isObject($ClientAim::Object)||!isObject($ClientAim::Self)||ServerConnection.getControlObject().getClassName()!$="Player") {
         ClientAim_Cancel(1);
         return;
      }
      %pos=$ClientAim::Object.getTransform();
      %fv=ServerConnection.getControlObject().getEyeVector();
      %x=getWord(%fv,0);
      %y=getWord(%fv,1);
      %vv=vectorNormalize(vectorSub(%pos,ServerConnection.getControlObject().getTransform()));
      %xx=getWord(%vv,0);
      %yy=getWord(%vv,1);
      $mvYaw=mATan(%xx,%yy)-mATan(%x,%y);
      $mvPitch=mATan(getWord(%fv,2),mSqrt(%x*%x+%y*%y))-mATan(getWord(%vv,2),mSqrt(%xx*%xx+%yy*%yy));
      $ClientAim::Tick=schedule(10,0,ClientAim_Lock,1,1);
      return;
   }
   if(!%val)
      return;
   for(%i=0;%i<ServerConnection.getCount();%i++) {
      %obj=ServerConnection.getObject(%i);
      if(%obj.getClassName()$="Player") {
         %temp=%obj.getShapeName();
         if(%obj==ServerConnection.getControlObject()) {
            %ownPos=%obj.getTransform();
            $ClientAim::Self=%obj;
         }
         else if(%temp!$="") {
            %pos[%cnt++]=%obj.getTransform();
            %ID[%cnt]=%obj;
            %name[%cnt]=%temp;
         }
      }
   }
   if(%ownPos$=""||!%cnt)
      return;
   %shortDist="";
   for(%i=1;%i<=%cnt;%i++) {
      %dist=mSqrt(mPow(getWord(%ownPos,0)-getWord(%pos[%i],0),2)+mPow(getWord(%ownPos,1)-getWord(%pos[%i],1),2)+mPow(getWord(%ownPos,2)-getWord(%pos[%i],2),2));
      if(%shortDist$=""||%dist<%shortDist) {
         %shortDist=%dist;
         %target=%ID[%i];
         %user=%name[%i];
      }
   }
   $ClientAim::Object=%target;
   $ClientAim::Active=1;
   clientCmdCenterPrint("\c5Your lock-on has been set to \c2"@%user@"\c5.",2);
   ClientAim_Lock(1,1);
}
function ClientAim_Cancel(%val) {
   if(!%val||!$ClientAim::Active)
      return;
   cancel($ClientAim::Tick);
   $ClientAim::Object="";
   $ClientAim::Self="";
   $ClientAim::Active=0;
   clientCmdCenterPrint("\c5Your lock-on has been \c0disabled\c5.",2);
}
Back to top Go down
http://physicsonlinegames.weebly.com
 
[TorqueScript] I Require help.
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
 :: Coding-
Jump to: