EventMap
Defined in: server/api.d.ts:2502
Native events dispatched through Events.on. Each property is the exact callback argument tuple for that event.
Properties
Section titled “Properties”actionPointHit
Section titled “actionPointHit”actionPointHit: [
ActionPoint,Player]
Defined in: server/api.d.ts:2661
Dispatched when a player activates a replicated action point.
consoleCommand
Section titled “consoleCommand”consoleCommand: [
string,string[]]
Defined in: server/api.d.ts:2516
Dispatched after the server console parses a command line that is not handled by a built-in command.
doorInteract
Section titled “doorInteract”doorInteract: [
Player,string,boolean,boolean]
Defined in: server/api.d.ts:2651
Dispatched after a player opens, closes, kicks, locks or lockpicks a world door, with the door’s new state. doorId is the id the Door functions take. Never dispatched for a door whose interaction is disabled.
entityStateChange
Section titled “entityStateChange”entityStateChange: [
Entity,string,any,any]
Defined in: server/api.d.ts:2746
Dispatched when one key of an entity’s state changes: on the server when a script writes it, on a client when the write arrives. value is undefined when the key was removed and previous is undefined when it held nothing before, so a stored null stays distinguishable from an absent key. The entity is whatever the game’s WrapScriptEntity answers, and the base Entity handle by default.
jukeboxUse
Section titled “jukeboxUse”jukeboxUse: [
Player,number]
Defined in: server/api.d.ts:2656
Dispatched when a player uses a synchronized jukebox.
markerHit
Section titled “markerHit”Defined in: server/api.d.ts:2666
Dispatched when a player enters a marker’s trigger radius.
markerLeave
Section titled “markerLeave”Defined in: server/api.d.ts:2681
Dispatched when a player leaves a marker’s trigger radius.
npcDeath
Section titled “npcDeath”npcDeath: [
Npc,Player|null,NpcDeathInfo]
Defined in: server/api.d.ts:2581
Dispatched when a server-driven NPC dies, whether from a player’s hit or from npc.kill().
playerAmmoChange
Section titled “playerAmmoChange”playerAmmoChange: [
Player,number,number,number]
Defined in: server/api.d.ts:2561
Dispatched when the reserve or loaded ammunition of a carried weapon changes. Reported at most once per client frame, so a burst of fire arrives as one change.
playerChat
Section titled “playerChat”playerChat: [
Player,string]
Defined in: server/api.d.ts:2596
Dispatched when a player submits a chat message.
playerCommand
Section titled “playerCommand”playerCommand: [
Player,string,string[]]
Defined in: server/api.d.ts:2601
Dispatched when a player’s chat input is parsed as a command.
playerConnect
Section titled “playerConnect”playerConnect: [
Player]
Defined in: server/api.d.ts:2521
Dispatched after an M2O player is connected and its script handle can be resolved.
playerConnecting
Section titled “playerConnecting”playerConnecting: [
PendingConnection]
Defined in: server/api.d.ts:2751
Dispatched when a player asks to join, before the connection exists: they hold no player slot, are not counted as online, and are sent nothing – no resource list, no download, no body. The request waits until every handler has returned and every Promise a handler returned has settled, then it is let in if a player slot is free (otherwise it is refused as full). connection.reject() turns it away instead, and so does a handler that throws or rejects, or handlers that have not settled within the server’s admission timeout (30 seconds by default, restarted by every connection.update()). With no handler at all, every request is let in at once.
playerDamage
Section titled “playerDamage”playerDamage: [
Player,PlayerDamageInfo]
Defined in: server/api.d.ts:2586
Dispatched when the server relays a bullet hit the shooter resolved against a player. Fires before the victim applies it, so the resulting health arrives with that player’s next sync.
playerDeath
Section titled “playerDeath”playerDeath: [
Player,Player|null,PlayerDeathInfo]
Defined in: server/api.d.ts:2576
Dispatched after the server receives and resolves a player’s death report.
playerDialNumber
Section titled “playerDialNumber”playerDialNumber: [
Player,number,string,number]
Defined in: server/api.d.ts:2646
Dispatched after a player dials a registered phone-book number.
playerDisconnect
Section titled “playerDisconnect”playerDisconnect: [
Player]
Defined in: server/api.d.ts:2526
Dispatched when an M2O player disconnects.
playerPinupCollected
Section titled “playerPinupCollected”playerPinupCollected: [
Player,number,number]
Defined in: server/api.d.ts:2641
Dispatched when a player takes a pinup collectible — the Playboy magazines and the wanted posters, told apart by galleryId, where 1 is the wanted-poster gallery. The collectible is already recorded against the player and hidden on their client; any reward is up to the gamemode. Collected sets are per player and live only for the session, so persist them yourself and restore them with setPinupCollected.
playerShopBuy
Section titled “playerShopBuy”playerShopBuy: [
Player,string,number,number,number,boolean,string]
Defined in: server/api.d.ts:2636
Dispatched after a player buys an item from a native shop; price is expressed in currency units.
playerShopClose
Section titled “playerShopClose”playerShopClose: [
Player,string,number,string]
Defined in: server/api.d.ts:2631
Dispatched when a player closes a native shop.
playerShopEnter
Section titled “playerShopEnter”playerShopEnter: [
Player,string,string,boolean,string]
Defined in: server/api.d.ts:2621
Dispatched when a player triggers a city shop, whether or not the native menu came up. nativeOpened is false when a client shopOpen handler suppressed the menu or the game refused the open; source is "walkIn" or "script".
playerShopOpen
Section titled “playerShopOpen”playerShopOpen: [
Player,string,string]
Defined in: server/api.d.ts:2626
Dispatched when a player opens a native shop. shopName is the friendly shopmenu2 configuration name, which is what the client’s Shop.open and this side’s Shop.setItem take; shopPath is the internal shop script path.
playerSpawn
Section titled “playerSpawn”playerSpawn: [
Player]
Defined in: server/api.d.ts:2531
Dispatched after an M2O player spawns or respawns.
playerSubmerged
Section titled “playerSubmerged”Defined in: server/api.d.ts:2591
Dispatched when a player goes underwater and the game’s drowning sequence starts (it resurfaces them on the nearest shore). vehicle is the one they went under in, or null on foot.
playerVoiceStart
Section titled “playerVoiceStart”playerVoiceStart: [
Player]
Defined in: server/api.d.ts:2566
Dispatched when a player starts speaking on voice chat. Tracks speech rather than the push-to-talk key – silence never reaches the server – and fires whether or not anyone is in earshot.
playerVoiceStop
Section titled “playerVoiceStop”playerVoiceStop: [
Player]
Defined in: server/api.d.ts:2571
Dispatched shortly after a player’s last voice frame reaches the server. A disconnect ends talking without this event, since the player is already gone; clean up on playerDisconnect too.
playerWaypointCleared
Section titled “playerWaypointCleared”playerWaypointCleared: [
Player,number,number]
Defined in: server/api.d.ts:2616
Dispatched when a player clears the active GPS waypoint.
playerWaypointReached
Section titled “playerWaypointReached”playerWaypointReached: [
Player,number,number]
Defined in: server/api.d.ts:2611
Dispatched when a player reaches the active GPS waypoint.
playerWaypointSet
Section titled “playerWaypointSet”playerWaypointSet: [
Player,number,number]
Defined in: server/api.d.ts:2606
Dispatched when a player places a GPS waypoint.
playerWeaponAdd
Section titled “playerWeaponAdd”playerWeaponAdd: [
Player,number,number,number]
Defined in: server/api.d.ts:2551
Dispatched when a weapon enters a player’s inventory, by any route: giveWeapon, a pickup, a shop, or a client the server never told to add it.
playerWeaponFire
Section titled “playerWeaponFire”Defined in: server/api.d.ts:2541
Dispatched when the server receives a weapon-fire report from a player.
playerWeaponRemove
Section titled “playerWeaponRemove”playerWeaponRemove: [
Player,number]
Defined in: server/api.d.ts:2556
Dispatched when a weapon leaves a player’s inventory: removeWeapon, a drop, a thrown weapon used up, or a respawn reset.
playerWeaponSwitch
Section titled “playerWeaponSwitch”playerWeaponSwitch: [
Player,number,number]
Defined in: server/api.d.ts:2536
Dispatched after the server receives the player’s authoritative weapon-switch update.
playerWeaponThrow
Section titled “playerWeaponThrow”Defined in: server/api.d.ts:2546
Dispatched when a player releases a grenade or Molotov.
resourceStart
Section titled “resourceStart”resourceStart: [
string]
Defined in: server/api.d.ts:2506
Dispatched after a resource entry point has run and immediately before the resource becomes running.
resourceStop
Section titled “resourceStop”resourceStop: [
string]
Defined in: server/api.d.ts:2511
Dispatched while a resource is stopping, before its stop callback, timers, exports, and event handlers are cleaned up.
vehicleDestroy
Section titled “vehicleDestroy”vehicleDestroy: [
Vehicle]
Defined in: server/api.d.ts:2691
Dispatched immediately before or while a replicated vehicle is destroyed.
vehicleExplode
Section titled “vehicleExplode”Defined in: server/api.d.ts:2696
Dispatched when a replicated vehicle explodes.
vehicleLightBroken
Section titled “vehicleLightBroken”vehicleLightBroken: [
Vehicle,number]
Defined in: server/api.d.ts:2706
Dispatched when one of a vehicle’s headlights is smashed by body deformation.
vehiclePartDropped
Section titled “vehiclePartDropped”vehiclePartDropped: [
Vehicle,number,number]
Defined in: server/api.d.ts:2701
Dispatched when a vehicle deform part is torn off its body. partType is a VehiclePartType value.
vehiclePlayerEntered
Section titled “vehiclePlayerEntered”Defined in: server/api.d.ts:2731
Dispatched after a player has entered a vehicle.
vehiclePlayerEntering
Section titled “vehiclePlayerEntering”Defined in: server/api.d.ts:2726
Dispatched when a player begins entering a vehicle seat.
vehiclePlayerExited
Section titled “vehiclePlayerExited”Defined in: server/api.d.ts:2741
Dispatched after a player has exited a vehicle.
vehiclePlayerExiting
Section titled “vehiclePlayerExiting”Defined in: server/api.d.ts:2736
Dispatched when a player begins exiting a vehicle.
vehicleRadioChange
Section titled “vehicleRadioChange”Defined in: server/api.d.ts:2721
Dispatched after a vehicle driver changes its radio station.
vehicleSpawn
Section titled “vehicleSpawn”vehicleSpawn: [
Vehicle]
Defined in: server/api.d.ts:2686
Dispatched immediately after a replicated vehicle is created.
vehicleSubmerged
Section titled “vehicleSubmerged”vehicleSubmerged: [
Vehicle]
Defined in: server/api.d.ts:2711
Dispatched when a replicated vehicle goes underwater.
vehicleSurfaced
Section titled “vehicleSurfaced”vehicleSurfaced: [
Vehicle]
Defined in: server/api.d.ts:2716
Dispatched when a previously submerged replicated vehicle leaves the water.
volumeHit
Section titled “volumeHit”Defined in: server/api.d.ts:2671
Dispatched when a player enters a volume. The crossing is detected by the game’s own physics sensor on that player’s client, not by polling, so it fires on body overlap rather than when the player’s origin crosses the boundary.
volumeLeave
Section titled “volumeLeave”Defined in: server/api.d.ts:2676
Dispatched when a player leaves a volume, including when the volume is disabled, moved away or destroyed. A player who disconnects leaves without this event, so clean up on playerDisconnect too.
