Looking for help modifying login broadcast script to add death cries. Been running it with death cries in, but we wanted to add what the player was killed by. After adding the section adding to the string what hte player was killed by, we had a server crash. Player was killed by acid trap on the ground, object not set to instance of an object. It seems like it didnt know what to do because they werent killed by a mobile but not sure on that. this is the section we added to broadcast deaths
any help is greatly appreciated
Code:
public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
{
if (e.Mobile.Player)
{
if (e.Mobile.AccessLevel == AccessLevel.Player)
CommandHandlers.BroadcastMessage(AccessLevel.Player, m_DeathHue, String.Format(m_DeathMessage, e.Mobile.Name));
{
if (e.Mobile.LastKiller.IsPlayer())
{
CommandHandlers.BroadcastMessage(AccessLevel.Player, m_DeathHue, String.Format("{0} was killed by {1}!", e.Mobile.RawName, e.Mobile.LastKiller.RawName));
}
else if (!e.Mobile.LastKiller.IsPlayer())
{
CommandHandlers.BroadcastMessage(AccessLevel.Player, m_DeathHue, String.Format("{0} was killed by {1}!", e.Mobile.RawName, e.Mobile.LastKiller.RawName));
}
}
}
}
any help is greatly appreciated