Hi, I've been making a quick event and cannot figure out why it doesn't work. It's supposed to be an event that makes a bot aim at the player entered with the name as a string. When I try to run it using exec I get this error:
Invalid script
anyway here's the code:
Server.cs:
//////////////////
//Event_MoreBotz//
//////////////////
//By: Zmaster587 ( ID )
// VERSION 1.0 //
//error("ERROR: Event_MoreBotz - required add-on Event_Bots not found");
if(!$MoreBotEventsLoaded)
{
RegisterOutputEvent(AIPlayer, "aimAtPlayerByName", "String 20 20");
$MoreBotEventsLoaded = true;
}
Package Morebot
{
function AIplayer::aimAtPlayerByName(%this, %playerName)
{
%player = findClientByName(%playerName);
if(%player != NULL)
{
%this.setAimObject(%player, Point3F(0,0,0));
}
}
}
activatePackage(Morebot);
Edit: I can enable it but when i go to use it in wrench events it is not in the AIPlayer category (bot).