Skip to main content

OnEntityModelChange

This event is triggered when a entity has changed model.

  • handle: parameter input should be in NetHandle type
  • oldModel: parameter input should be in uint type

{{#tag:syntaxhighlight| [ServerEvent(Event.EntityModelChange)] public void OnEntityModelChange(NetHandle handle, uint oldModel) {

   switch (handle.Type)
   \{
       case EntityType.Player:
       \{
           var player = handle.Entity<Client>();
           player.SendChatMessage($"Your model has changed from \{oldModel\} to \{player.Model\}!");
           break;
       \}
   \}

} |lang=csharp}} }}