Device_TargetHit
Skip to content
mnscript
Device_TargetHit(TargetDevice, Player, string, string) 

Description ​

Invoked when a connected Target is hit

Arguments ​

TargetDevice - The TargetDevice which was hit
Player - The Player who hit the target
string - Damage inflicted
string - Weapon used

Example ​

msc
using Console;
using Util;
using Event;
using Player;
using Device;

function OnTargetHit(TargetDevice target, Player player, string damage, string weapon){
    Console.WriteLine(player.GetName().." hit target! with "..Util.ToString(weapon).." with "..Util.ToString(damage));
}

Event.AddListener("Device_TargetHit", "targets", "OnTargetHit");