We've moved! Join us as we continue development on our new site at umod.org!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  1. Code:
    // DoorCloser
    [global::BaseEntity.RPC_Server, global::BaseEntity.RPC_Server.MaxDistance(3f)]
    public void RPC_Take(global::BaseEntity.RPCMessage rpc)
    {
        if (!rpc.player.CanInteract())
        {
            return;
        }
        if (!rpc.player.CanBuild())
        {
            return;
        }
        global::Door door = this.GetDoor();
        if (door == null)
        {
            return;
        }
        if (!door.GetPlayerLockPermission(rpc.player))
        {
            return;
        }
        // begin
        object obj = Interface.CallHook("CanTakeDoorCloser", this, rpc.player);
        if (obj is bool)
        {
            return (bool)obj;
        }
        // end
        global::Item item = global::ItemManager.Create(this.itemType, 1, this.skinID);
        if (item != null)
        {
            rpc.player.GiveItem(item, global::BaseEntity.GiveItemReason.Generic);
        }
        base.Kill(global::BaseNetworkable.DestroyMode.None);
    }
     
    redBDGR likes this.