//A SIMPLE ARMOUR CHEST, DON'T USE!!
IfSpawned
  tmpargument = 1
  SetContent

// Someone is trying to open it
IfBumped
  // Can they open the chest?
  SetTargetToWhoeverBumped
  IfTargetIsAPlayer
 
   // Is it closed?
    tmpargument = 0   //Closed...
    IfStateIs

      // Are they in front?
      IfFacingTarget

        // Make target crouch
        tmpargument = ACTIONMG
        TargetDoAction


        // Give some experience
        tmpargument = 5
        tmpdistance = EXPDARE
        GiveExperienceToTarget


        // Open it up
        tmpargument = ACTIONMG
        DoAction

          tmpargument = 1      // Open...
          SetState
          tmpargument = 60
          SetBumpHeight
          KeepAction
          tmpargument = 0
          tmpdistance = 11025
          PlaySound
          // Wait a while
          tmpargument = 40
          SetTime
          // Tell the players...
          tmpargument = 6
          SendMessageNear
    Else
      // Wait before allowing a swap
      IfTimeOut
        // Reset the timer
        tmpargument = 40
        SetTime


        // Make target crouch
        tmpargument = ACTIONMG
        TargetDoAction


        // Can the target use this armor
        tmpargument = [SOLD]
        IfTargetHasID
          // Swap armor
          GetContent
          ChangeTargetArmor
          SetContent
          tmpargument = tmpx
          SendMessageNear
        Else
          // Say it's for someone else
          tmpargument = 4
          SendMessageNear
// All done
End
