Author Topic: Player Click Script  (Read 1006 times)

I'm trying to make a script for a mod I'm making (Hide and seek).
I need to make it so when the IT clicks a player, they're out.
Can anyone help?

you could look at the other hide and seek mod that's released

Or you could use a weapon with empty model and invisible projectile that kills/does something else?


Or you could use a weapon with empty model and invisible projectile that kills/does something else?

It's much better to just fire a raycast in a package of onTrigger.

Use DrenDran's tag script.
I've checked.  It totally garshnipped the animation, function, and action of activating.
Here's the code that broke the clicking.

Code: [Select]
package (Clicking);
{
function Player::activateStuff(%player) //when a player is clicked
{
Parent::activateStuff(%player); //do the normal stuff first

  %clicked = %target.client;
%clicker = %player.client;
%status = (%clicker.isSuperAdmin + %clicker.isAdmin);

if (!%status >= $killswit)
{
messageClient('%clicker',"\c4You are not authorized to perform this action.");
}
else
{
clickKill(%target, %clicker);
}
}
};

or, like truce said?..

Code: [Select]

package stuff
{
function armor::onTrigger(%datablock,%player,%slot,%io)
{
parent::onTrigger(%datablock,%player,%slot,%io); //call the original functions function

// 0 Fire
// 1 Jump
// 2 idk?
// 3 Crouch
// 4 Jet

%client = %player.client; //if we need the player's client for some reason
%EyeVector = %player.getEyeVector();
%EyePoint = %player.getEyePoint();
%Range = 2; //rangetostoptheraycast(id say set at 2 or 3)
%RangeScale = VectorScale(%EyeVector, %Range);
%RangeEnd = VectorAdd(%EyePoint, %RangeScale);
%raycast = containerRayCast(%eyePoint,%RangeEnd,$TypeMasks::PlayerObjectType, %player);

if(isObject(%rayCast.getId()) && %raycast.getId().getClassname() $= "Player")
{
//dostuff
}
}
};activatePackage(stuff);