Device_MetalDetectorTriggered
Skip to content
mnscript
Device_MetalDetectorTriggered(MetalDetectorDevice, Player, bool, bool) 

Description ​

Invoked when a connected Metal Detector is triggered

Arguments ​

MetalDetectorDevice - The MetalDetectorDevice which was triggered
Player - The Player who triggered the detector
bool - Whether the player is carrying an illegal weapon
bool - 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");