NullReferenceException when using OnExplosiveThrownSolved
private void OnExplosiveDropped(BasePlayer player, BaseEntity entity) => OnExplosiveThrown(player, entity);

private void OnExplosiveThrown(BasePlayer player, BaseEntity entity)
{
    TimedExplosive timedExplosive = entity.GetComponent<TimedExplosive>();
    entity.Spawn();

    if (timedExplosive != null)
        return;

    entity.Kill();
    player.ChatMessage("<color=orange>C4's are disabled.</color>");
}

Im trying to make so you cant throw c4.

But it is just failing the hook :|

Remove 'entity.Spawn()', you don't need to spawn the entity (you are getting the error because you are trying to spawn something that is already spawned) and change the '!=' to '==' otherwise you will skip the bit of code that stops the c4 being thrown when the thrown entity is a c4
0x89A
Remove 'entity.Spawn()', you don't need to spawn the entity (you are getting the error because you are trying to spawn something that is already spawned) and change the '!=' to '==' otherwise you will skip the bit of code that stops the c4 being thrown when the thrown entity is a c4

Thanks, It is working. but it disables all the throwables, Supply signals, etc. I want it to only disable C4, TimedExplosive

private void OnExplosiveDropped(BasePlayer player, TimedExplosive entity) => entity.Kill();

private void OnExplosiveThrown(BasePlayer player, TimedExplosive entity) => entity.Kill();
Locked automatically