[T1] Modifying a taunt script

fuppedbuck

Veteran X
In my quest to find a script that played a local taunt from the 5150 soundpack whenever a kill was made, the closest thing I found was a flag taunt script that does the same thing. What I want to do is just change this so that the event is linked to killing a player instead of capturing the flag. This is what the script looks like now:

Code:
// Flag Taunt Script
//
// Pr0nigy Flag Taunting
// Because everyone is a little bit of an ass.

echo("Flag taunting by Pr0nigy.");

// 5150 Pack Support
$Taunt::5150pack = true;

// Bind to a key
$Taunt::Key = "L;

// Define Taunts
if ($Taunt::5150pack) {

        //Number of defined taunts
        $Taunt::Max = 21;


	$Taunt::Taunt[0] = "takcovr";
        $Taunt::Taunt[1] = "lard";
        $Taunt::Taunt[2] = "oops1";
        $Taunt::Taunt[3] = "cheer1";
        $Taunt::Taunt[4] = "meep";
        $Taunt::Taunt[5] = "taunt10";
        $Taunt::Taunt[6] = "hbye";
        $Taunt::Taunt[7] = "cheer2";
        $Taunt::Taunt[8] = "ohbilly";
        $Taunt::Taunt[9] = "cheer3";
        $Taunt::Taunt[10] = "jerk2";
        $Taunt::Taunt[11] = "fookyu2";
        $Taunt::Taunt[12] = "boomstick";
        $Taunt::Taunt[13] = "shebitch";
        $Taunt::Taunt[14] = "cmon";
        $Taunt::Taunt[15] = "care";
        $Taunt::Taunt[16] = "damn";
        $Taunt::Taunt[17] = "peek";
        $Taunt::Taunt[18] = "easy";
        $Taunt::Taunt[19] = "yoda";
        $Taunt::Taunt[20] = "impress";
        $Taunt::Taunt[21] = "good";
} else {

        //Number of defined taunts
        $Taunt::Max = 7;

        $Taunt::Taunt[0] = "needdef";
        $Taunt::Taunt[1] = "oops1";
        $Taunt::Taunt[2] = "cheer1";
        $Taunt::Taunt[3] = "taunt10";
        $Taunt::Taunt[4] = "cheer2";
        $Taunt::Taunt[5] = "cheer3";
        $Taunt::Taunt[6] = "takcovr";
        $Taunt::Taunt[7] = "oops2";
}

// Attach to message events
Event::Attach(eventClientMessage, FlagTaunt::Parse);

// Bind the key
bindcommand(keyboard0, make, $Taunt::Key, TO, "FlagTaunt::Toggle();");

// Toggle Taunting
function FlagTaunt::Toggle() {
        if ($FlagTaunt::On) {
                $FlagTaunt::On = false;
                remotecp(2048, "<f1>FlagTaunt Status is: <f2>OFF", 1);
	} else {
                $FlagTaunt::On = true;
                remotecp(2048, "<f1>FlagTaunt Status is: <f2>ON", 1);
	}	
}

// Taunt them bitches
function FlagTaunt::Parse(%cl, %msg)
{
        if (!$FlagTaunt::On) return;
	if(%cl != 0)
	{
		return;
	}
        if(String::FindSubStr(%msg, "You took the") != -1 )
	{
               %randTaunt = floor(getRandom() * ($Taunt::Max-1));
		remoteEval(2048, lmsg, $Taunt::Taunt[%randTaunt]);
	}
        else if(String::FindSubStr(%msg, "You left the mission area while") != -1 )
        {
               Say::Animation(doh, 4);
        }
}

I know basically nothing about scripting so I don't know if this would be difficult to do or not, but any help would be much appreciated. Thanks.
 
This code hasn't been tested, but should work.
Code:
function KILLTaunt(%killer, %victim, %weapon)
{
        TauntDefaults();
	if(%killer == getManagerId() && ( %weapon != "Suicide" || %weapon != "Turret" ))
	{
		if ($Taunt::Total > 0)
		{
			$Taunt = floor(getRandom() * $Taunt::Total);
			localMessage($Taunt::Message[$Taunt]);
		}
	}
}

function TauntDefaults()
{
	$Taunt::Total = "14";
	$Taunt::Message[0] = "hello";
	$Taunt::Message[1] = "east2";
	$Taunt::Message[2] = "myself";
	$Taunt::Message[3] = "meep2";
	$Taunt::Message[4] = "yipe";
	$Taunt::Message[5] = "takeoff";
	$Taunt::Message[6] = "humpty2";
	$Taunt::Message[7] = "wbslap";
	$Taunt::Message[8] = "ohbilly";
	$Taunt::Message[9] = "lard";
	$Taunt::Message[10] = "clap";
	$Taunt::Message[11] = "hurt";
	$Taunt::Message[12] = "peek";
	$Taunt::Message[13] = "jay";
}
Event::Attach(eventKillTrak, KILLTaunt);
 
There's no error on line 1, but it won't work anyways. Theres nothing finding out that you have been killed. What you want to do is replace where it says

if(String::FindSubStr(%msg, "You took the") != -1 )

and replace the "You took the" with whatever part of a message is always put in whenever someone is killed. So if when you're killed it says, "you killed <playerName>", you would want to make it this

if(String::FindSubStr(%msg, "You killed") != -1 )

I never really used presto so I can't help you with that, but I hope you know what I'm saying.
 
Back
Top