mnscript
Device_MetalDetectorTriggered(MetalDetectorDevice, Player, bool, bool)
Description ​
Invoked when a connected Metal Detector is triggered
Arguments ​
MetalDetectorDevice
- The MetalDetectorDevice which was triggeredPlayer
- The Player who triggered the detectorbool
- Whether the player is carrying an illegal weaponbool
- Whether the player was police
Example ​
msc
using Console;
using Util;
using Event;
using Player;
using Device;
function OnMetalDetectorTriggered(MetalDetectorDevice detector, Player player, bool hasIllegalWeapons, bool isPolice){
Console.WriteLine(player.GetName().." walked through a metal detector! Police: "..Util.ToString(isPolice));
}
Event.AddListener("Device_MetalDetectorTriggered", "metal detectors", "OnMetalDetectorTriggered");