Ignore them. Scripting is harder for some people to learn than others.
I've never been to amazing at geometry in 2d, let alone 3d, so I can't really help you with getting the player to face the 'target'. However, I can help you to warp them nearby.
package CreepyPlayer // We're editing a default function. We package this.
{
function serverCmdLight(%client) // When they press their light key
{
if(!isObject(%client.player)) // If they don't have a player
return; // Skip the rest of the code
if(%client.player.getDatablock().getName() !$= "PlayerCreepyData") //If they are not a creepy player
{
parent::serverCmdLight(%client); // Toggle their light
return; // Skip the rest of the code
}
if(clientGroup.getCount() < 2) //If there are no players or only 1 player on the server
return; // Skip the rest of the script. There is no one to target.
%randomplr = getRandom(0,clientGroup.getCount()); // Get a random number corresponding to a client.
%target = clientGroup.getObject(%randomplr); // Get the client corresponding to the random number above.
if(!isObject(%target.player))
{
for(%i = 1; %i < clientGroup.getCount(); %i++)
{
%randomplr = (%randomplr + 1) % clientGroup.getCount();
if(isObject(clientGroup.getObject(%randomplr).player))
{
%target = clientGroup.getObject(%randomplr); // Set the viable target
%foundtarg = 1; // We have found a viable target
break; // Lets get out of this for loop
}
}
if(!%foundtarg) // If we didn't find a viable target
{
messageClient(%client, '', "No one is spawned!"); // Inform them no one has spawned.
return; // Skip the rest of the function
}
}
if(%target.player.getDatablock().getName() $= "PlayerCreepyData") // If the target is a creepy player
{
for(%test = 1; %test < clientGroup.getCount(); %test++)
{
%check = (%target + %test) % clientGroup.getCount(); // Get the next player (wrap around to beginning)
%checkplr = clientGroup.getObject(%check); // Get the next player's client
if(isObject(%checkplr.player)) // If the target's player exists
{
if(%checkplr.player.getDatablock().getName() !$= "PlayerCreepyData") // If the target ISN'T a creepy player
{
%target = %checkplr; // They are the new target.
%foundplr = 1; // We found a player to use as a target.
break; // Let's get out of this for loop.
}
}
}
}
if(!%foundplr) // If we didn't find a normal player
{
messageClient(%client, '', "No normal players could be found!"); // Tell them!
return; // Skip the rest of the function
}
%distx = getRandom(0, 14) + 6; // Get a number 6-20
%mul = getRandom(0,1); // Negative or positive?
if(%mul == 0) // If negative
%distx *= -1; // Make the number negative
%disty = getRandom(0, 14) + 6;
%mul = getRandom(0,1);
if(%mul == 0)
%disty *= -1;
%distz = getRandom(0, 14) + 6;
%mul = getRandom(0,1);
if(%mul == 0)
%distz *= -1;
%dist = %distx SPC %disty SPC %distz; // make the vector string
%pos = vectorAdd(%dist, %target.player.getTransform()); // Add the target's position in
%client.player.setTransform(%pos); // Move the player to that distance from the target
}
};
activatePackage(creepyPlayer); // Activate the package.
DAMN. That took longer to type up than I figured when I first started. Oh well. I hope it helps you! Fully commentated to hopefully solve all questions.