# onPlayerTriggerEventThreshold (Server)

> Fired when a player calls `triggerServerEvent` or `triggerLatentServerEvent` too many times in an interval. The server does nothing else: what to do is up to the scripts.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Event
- **Side**: Server
- **Category**: Events
- **URL**: https://wiki.mymp.gg/en/onPlayerTriggerEventThreshold

## Syntax

```lua
addEventHandler("onPlayerTriggerEventThreshold", root, function(string lastEventName) ... end)
```

## Handler parameters

| Name | Type | Description |
| --- | --- | --- |
| `lastEventName` | `string` | The name of the last event they triggered. |

## Source

The player that went over the limit.

The limit is `max_player_triggered_events_per_interval` (100) events in `player_triggered_event_interval` milliseconds (1000), two server convars.

## Example

```lua
addEventHandler("onPlayerTriggerEventThreshold", root, function(lastEventName)
    kickPlayer(source, "too many events (" .. lastEventName .. ")")
end)
```

## See also

- [triggerServerEvent (Client)](https://wiki.mymp.gg/en/triggerServerEvent.md): Sends an event to the server, which triggers it on source there. The function returns before the server receives it.
- [triggerLatentServerEvent (Client)](https://wiki.mymp.gg/en/triggerLatentServerEvent.md): Sends an event to the server bit by bit, in the background, at no more than bandwidth bytes a second. Meant for large data that must not hold up the rest of the traffic.
- [kickPlayer (Server)](https://wiki.mymp.gg/en/kickPlayer.md): Disconnects a player from the server with a reason.
