mnscript
Device_KeypadActivated(KeypadDevice, Player, bool, number)
Description ​
Invoked when a connected Keypad device is activated
Arguments ​
KeypadDevice
- The KeypadDevice which was activatedPlayer
- The Player who activated the Keypadbool
- Whether the passcode was correct or incorrectnumber
- The passcode which was entered
Example ​
msc
using Console;
using Event;
using Player;
using Util;
using Device;
function OnKeypadActivated(KeypadDevice keypad, Player player, bool wasCorrect, number keycode){
Console.WriteLine(player.GetName().." entered the keypad code: "..Util.ToString(keycode));
if(wasCorrect){
Console.WriteLine("The code was correct!");
}else{
Console.WriteLine("The code was wrong!");
}
}
Event.AddListener("Device_KeypadActivated", "keypads", "OnKeypadActivated");