Blockland Forums > Modification Help
Teleporting A Player To Another Player
<< < (3/4) > >>
Greek2me:

--- Code: ---function serverCmdMoveToPlayer(%client,%targetNameA,%targetNameB)
{
%targetA = findClientByName(%targetNameA);
%targetB = findClientByName(%targetNameB);

if(!isObject(%targetA.player) || !isObject(%targetB.player))
return;

%targetA.player.setTransform(%targetB.player.getTransform());
}
--- End code ---
Brian Smithers:
Fixed

--- Quote from: Mr.jacksaunt on February 14, 2012, 05:47:50 PM ---Brian
That was your 666th post

--- End quote ---
Atleast it was helpful :)
Port:

--- Code: ---function serverCmdTP( %cl, %nm1, %nm2 )
{
if ( !%cl.isAdmin )
{
return;
}

if ( !isObject( %cl1 = findClientByName( %nm1 ) ) )
{
return;
}

if ( !isObject( %cl2 = findClientByName( %nm2 ) ) )
{
return;
}

if ( !isObject( %pl1 = %cl1.player ) )
{
return;
}

if ( !isObject( %pl2 = %cl2.player ) )
{
return;
}

%pl1.setTransform( %pl2.getTransform() );
%pl1.teleportEffect();

messageClient( %cl1, '', "\c3" @ %cl.name @ " \c6has teleported you to \c3" @ %cl2.name @ "\c6." );
messageClient( %cl2, '', "\c3" @ %cl.name @ " \c6has teleported \c3" @ %cl1.name @ " \c6to you." );
}

--- End code ---
Chrono:
Let's not confuse new scripters with a gigantic mess.
jes00:
Hmm, Port reminded me to do an admin check but how do I put the teleport effect on a player?
Navigation
Message Index
Next page
Previous page

Go to full version