Begin OnEquip player set AmmoSwitch to 2EndBegin GameMode set Frag to player.GetItemCount WeapGrenadeFrag set Plasma to player.GetItemCount WeapGrenadePlasma set Pulse to player.GetItemCount WeapGrenadePulse set Nuka to player.GetItemCount WeapNukaCocktail set AmmoCount to player.GetItemCount AmmoMatol if Frag == 0 && Plasma == 0 && Pulse == 0 && Nuka == 0 set AmmoSwitch to 1 endif if AmmoSwitch == 1 ShowMessage MatolAmmoFail elseif AmmoSwitch == 2 ShowMessage MatolAmmoMessage set Button to GetButtonPressed if Button == -1 ; None of the buttons have been pressed yet Return elseif Button == 0 ; Frag Grenades chosen ShowMessage test player.AddItem AmmoMatol Frag set Projectile to GrenadeFragProjectile elseif Button == 1 ; Plasma Grenades chosen player.AddItem AmmoMatol Plasma set Projectile to GrenadePlasmaProjectile elseif Button == 2 ; Pulse Grenades chosen player.AddItem AmmoMatol Pulse set Projectile to GrenadePulseProjectile else ; Nuka Grenades chosen player.AddItem AmmoMatol Nuka set Projectile to GrenadeNukaProjectile endif SetWeaponProjectile Projectile set AmmoSwitch to 0 endifEnd
Whenever the weapon is equipped, the message box just keeps appearing no matter which option is chosen. Any ideas what's causing this infinite loop?