#  ![](https://www.realm667.com/media/kunena/topic_icons/realm667_repo/user/rep_approved.png) \[SUBMISSION\] UAC PIstol

##

- **Gothic**
- ![Gothic's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar320.png?1619787674)
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 1329
-
-
-

   3 years 3 months ago [\#10559](#10559) by Gothic  Replied by *Gothic* on topic *[\[SUBMISSION\] UAC PIstol](https://www.realm667.com/forum/closed-submissions/1778-submission-uac-pistol?start=10#10559 "Information:

Name: UAC Pistol
Class: 2
Type: Hitscan
Palette: Doom
Summon: uacpistol
Ammo Type: clip

Credits:
Code: Tyrannotitan Fan
Sounds: OneShotOfficial, DICE
Sprites: Amuscaria/Eriance
Idea Base: Basic reloadable pistol.

Description:
Your trusty Glock-17-ish pistol

Sprite:
https://www.dropbox.com/s/3gt82dyq9zx1ngd/DEPIA0.png?dl=0
https://www.dropbox.com/s/zxhsxo4w4ufqcrw/DPIGA0.png?dl=0
Download Link:
https://www.dropbox.com/s/6gkq19xonko8a4w/UAC_Pistol.pk3?dl=0")*

 The altfire doesn't use any ammo, you need to give it the +WEAPON.ALT_USES_BOTH flag.
And since the firing is a little more complicated, you're gonna need to drop the checkforreload system, and start using an inventory item to keep count of your shots, like this:

Spawn:
DEPI A -1
Stop
Ready:
TNT1 A 0 A_JumpIf(CountInv("ShotCounter")&lt;1,"ReadyNoReload")
DPIG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
Loop
ReadyNoReload:
DPIG A 1 A_WeaponReady
Goto Ready
Deselect:
DPIG A 1 A_Lower(17)
Loop
Select:
DPIG A 1 A_Raise(17)
Loop
Fire:
TNT1 A 0 A_GunFlash
DPIF A 2 Bright A_FireBullets(2,2,-1,6,"BulletPuff",1)
DPIG B 1 A_GiveInventory("ShotCounter",1)
DPIG C 3
DPIG A 3 A_JumpIfInventory("ShotCounter",18,"DryFire")
Goto Ready
AltFire:
TNT1 A 0 A_GunFlash
DPIF A 2 Bright A_FireBullets(2,2,-1,6,"BulletPuff",1)
DPIG B 1 A_GiveInventory("ShotCounter",1)
DPIG C 3
TNT1 A 0 A_JumpIfInventory("ShotCounter",18,"DryFire")
DPIF A 2 Bright A_FireBullets(2,2,-1,6,"BulletPuff",1)
DPIG B 1 A_GiveInventory("ShotCounter",1)
DPIG C 3
TNT1 A 0 A_JumpIfInventory("ShotCounter",18,"DryFire")
DPIF A 2 Bright A_FireBullets(2,2,-1,6,"BulletPuff",1)
DPIG B 1 A_GiveInventory("ShotCounter",1)
DPIG C 3
DPIG A 3 A_JumpIfInventory("ShotCounter",18,"DryFire")
Goto Ready
DryFire:
DPIG A 6
DPIG A 6 A_PlaySound("weapons/glockdry")
Goto Reload
Reload:
DPIR A 3 A_TakeInventory("ShotCounter",18)
DPIR B 3 A_Playsound ("CLIPOUT")
DPIR C 3
DPIR D 3
DPIR E 3
DPIR F 3 A_Playsound ("CLIPIN")
DPIR G 3
DPIR H 3
DPIR I 3
DPIR J 3
DPIG A 3
Goto Ready
Flash:
TNT1 A 2 A_Light2
TNT1 A 2 A_Light1
Goto LightDone

(I changed the amount of shots to 18, so it's a number divisible by 3)
And then use an inventory item like this:

Actor ShotCounter : Inventory
{
-INVENTORY.INVBAR
Inventory.MaxAmount 18
}

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzc4LXN1Ym1pc3Npb24tdWFjLXBpc3RvbD9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **TyrannotitanFan**
- ![TyrannotitanFan's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar11787.png?1781431990) Topic Author
- Lost Soul
- ![Lost Soul](https://www.realm667.com/media/kunena/ranks/rank_7_skull.png)

 Less More- Posts: 92
-
-
-
-

   3 years 3 months ago [\#10560](#10560) by TyrannotitanFan  Replied by *TyrannotitanFan* on topic *[\[SUBMISSION\] UAC PIstol](https://www.realm667.com/forum/closed-submissions/1778-submission-uac-pistol?start=10#10560 "Information:

Name: UAC Pistol
Class: 2
Type: Hitscan
Palette: Doom
Summon: uacpistol
Ammo Type: clip

Credits:
Code: Tyrannotitan Fan
Sounds: OneShotOfficial, DICE
Sprites: Amuscaria/Eriance
Idea Base: Basic reloadable pistol.

Description:
Your trusty Glock-17-ish pistol

Sprite:
https://www.dropbox.com/s/3gt82dyq9zx1ngd/DEPIA0.png?dl=0
https://www.dropbox.com/s/zxhsxo4w4ufqcrw/DPIGA0.png?dl=0
Download Link:
https://www.dropbox.com/s/6gkq19xonko8a4w/UAC_Pistol.pk3?dl=0")*

 Got it
https://www.dropbox.com/s/6gkq19xonko8a4w/UAC_Pistol.pk3?dl=0

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzc4LXN1Ym1pc3Npb24tdWFjLXBpc3RvbD9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

- **Gothic**
- ![Gothic's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar320.png?1619787674)
- Moderator
- ![Moderator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 1329
-
-
-

   3 years 3 months ago [\#10566](#10566) by Gothic  Replied by *Gothic* on topic *[\[SUBMISSION\] UAC PIstol](https://www.realm667.com/forum/closed-submissions/1778-submission-uac-pistol?start=10#10566 "Information:

Name: UAC Pistol
Class: 2
Type: Hitscan
Palette: Doom
Summon: uacpistol
Ammo Type: clip

Credits:
Code: Tyrannotitan Fan
Sounds: OneShotOfficial, DICE
Sprites: Amuscaria/Eriance
Idea Base: Basic reloadable pistol.

Description:
Your trusty Glock-17-ish pistol

Sprite:
https://www.dropbox.com/s/3gt82dyq9zx1ngd/DEPIA0.png?dl=0
https://www.dropbox.com/s/zxhsxo4w4ufqcrw/DPIGA0.png?dl=0
Download Link:
https://www.dropbox.com/s/6gkq19xonko8a4w/UAC_Pistol.pk3?dl=0")*

 [ Added](https://www.realm667.com/en/repository-18489/armory-mainmenu-157-97317/doom-style-mainmenu-158-94349/2526-uac-pistol)
I had to make some minor fixes I forgot to report, I converted the sounds to ogg, as one of them didn't play properly, and added a Weapon.AmmoGive amount, because I couldn't pick it up.

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL2Nsb3NlZC1zdWJtaXNzaW9ucy8xNzc4LXN1Ym1pc3Npb24tdWFjLXBpc3RvbD9zdGFydD0xMA==&Itemid=2662) or [Create an account](https://www.realm667.com/component/users/registration?Itemid=2662) to join the conversation.

[Powered by](https://www.realm667.com/forum/credits) [Kunena Forum](https://www.kunena.org)
