You can choose the one you like the most. Meanwhile, a custom events handler may be easier to work with for beginners, legacy events can give more freedom in the development stage.
Using events
Each event has a different usage. Whenever you subscribe a method to an event it should have an event argument parameter following the next example:
voidOnWaveRespawned(WaveRespawnedEventArgsargs){ // Your code }
Some events don't have any type of argument, these events include ServerEvents.RoundStarted, ServerEvents.WaitingForPlayers...
Using the arguments
Each argument has different properties you may use for your advantage
Some event arguments have a special property: IsAllowed which allows events to be cancelled:
Cancellable events usually end with -ing
All the properties in the event arguments that have setters can be freely edited.
Wow! You learn fast. That is all events provide, go ahead and test them out!
void OnPlayerChangingRole(PlayerChangingRoleEventArgs args)
{
args.IsAllowed = false;
// The player role won't change!
}
void OnPlayerChangingRole(PlayerChangingRoleEventArgs args)
{
// PlayerChangingRoleEventArgs.NewRole has a setter.
args.NewRole = RoleTypeId.Tutorial;
// In this case example, if I set it to Tutorial
// it will always set the player role to Tutorial when it changes!
}