Author Topic: Need help scripting.  (Read 6324 times)

To compare strings:

$=
!$=


To compare anything else:

==
!=

And the or sign is || right?


Correct.
And whats the best way to find the distance between 2 players?

And whats the best way to find the distance between 2 players?
vectorDist(%c1.getPosition(), %c2.getPosition());

Why is this script
Code: [Select]
suddenly not working?
nvm got it
« Last Edit: June 27, 2012, 09:36:48 PM by zefoo »

Why is this part of my code
not working?
i can pick them up at any distance.

NVM

Why is is part of my code
Code: [Select]
%distance1 = vectorDist(%player1pos.getPosition(),%player2pos.getPosition());
            %client2 = findClientByName(%targetName);

            if(distance1 < 1)
            {
                messageClient(%client,'',"<color:ffffff>Grabbing <color:ffff00>" @ %objectName);
                %client.player.mountobject(findclientbyname(%objectName).player,0);
                %client2.messageClient(%client,'',"<color:ffff00>" @ %playername @ "<color:ffffff> grabbed you!");
            }

            if(distance1 > 1)
            {
                messageClient(%client,'',"<color:ffff00>" @ %objectName @ "<color:ffffff> is to far awway!");
            }
Now working. It allows me to grab someone even if they are really really far from me.

Why are you getting the position of a position...
You really have to try thinking through your code a bit more

Why are you getting the position of a position...
You really have to try thinking through your code a bit more
Its not what you think. %player1pos = %client.player

Its not what you think. %player1pos = %client.player
That's a misleading variable name, especially because you didn't post the code where it is set.

That's a misleading variable name, especially because you didn't post the code where it is set.
Yea sorry lol.

Why is is part of my code
Code: [Select]
%distance1 = vectorDist(%player1pos.getPosition(),%player2pos.getPosition());
            %client2 = findClientByName(%targetName);

            if(distance1 < 1)
            {
                messageClient(%client,'',"<color:ffffff>Grabbing <color:ffff00>" @ %objectName);
                %client.player.mountobject(findclientbyname(%objectName).player,0);
                %client2.messageClient(%client,'',"<color:ffff00>" @ %playername @ "<color:ffffff> grabbed you!");
            }

            if(distance1 > 1)
            {
                messageClient(%client,'',"<color:ffff00>" @ %objectName @ "<color:ffffff> is to far awway!");
            }
Now working. It allows me to grab someone even if they are really really far from me.

Its not what you think. %player1pos = %client.player

Would it be
Code: [Select]
if(distance << 1)
{

}
?

Also how do you mount a players node number to a players node number?
« Last Edit: June 27, 2012, 10:48:57 PM by zefoo »

Would it be
Code: [Select]
if(distance << 1)
{

}
?

Also how do you mount a players node number to a players node number?

Change distance1 < 1 to %distance1 < 1 and change 1 to about.. 3 or 4.

You can mount a player object to another player object.

%slot = 0;
%player1.mountObject(%player2,%slot);


What slot would be the neck or body?

Not sure off the top of my head, it's not hard to find out though.