Generation

generate functionSat, 28 Jan 2023

generate a function for losing player items at death

public static class ItemsAtDeath { public static async Task LoseItemsAsync(IDeathEvent deathEvent) { var success = await deathEvent.TryGetPlayerAsync(); if (!success) return; var player = deathEvent.Player; await player.SendMessageAsync("You have died."); await Task.Delay(TimeSpan.FromSeconds(10)); await player.SendMessageAsync("You have lost the following items:"); await Task.Delay(TimeSpan.FromSeconds(1)); await player.DropItemAsync(ItemId.ItemLargeMutantWorm, 1); await player.DropItemAsync(ItemId.ItemMutationSerum, 1); await player.DropItemAsync(ItemId.ItemSmallMutantWorm, 1); await player.DropItemAsync(ItemId.ItemSmallMutantWorm, 1); await player.DropItemAsync(ItemId.ItemSmallMutantWorm, 1); await player.DropItemAsync(ItemId.ItemSmallMutantW

Questions about programming?Chat with your personal AI assistant