#  ![](https://www.realm667.com/media/kunena/topic_icons/realm667/user/barrel.png) How to make a range gun available only in berserk

##

- **CaptainManiac**
- ![CaptainManiac's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar4791.png) Topic Author
- Cacodemon
- ![Cacodemon](https://www.realm667.com/media/kunena/ranks/rank_8_caco.png)

 Less More- Posts: 103
-
-
-
-

   10 years 6 months ago [\#3098](#3098) by CaptainManiac  *[How to make a range gun available only in berserk](https://www.realm667.com/forum/the-workshop/586-how-to-make-a-range-gun-available-only-in-berserk#3098 "I am making a shotgun that shoots blasts of hellfire,but i want it to be available only in berserk mode(need berserk power to get the weapon ready,even if it is picked up).When i put the...")* was created by *CaptainManiac*

 I am making a shotgun that shoots blasts of hellfire,but i want it to be available only in berserk mode(need berserk power to get the weapon ready,even if it is picked up).When i put the jumpifinventory actor function to make the gun ready only if the player has berserk power and because of that,an error named "sprite names must be exactly 4".I have 2 sprites for the ready animation.How to fix that?

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

- **Blue Shadow**
- ![Blue Shadow's Avatar](https://www.realm667.com/media/kunena/core/svg/person.svg)
- Administrator
- ![Administrator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 1131
-
-
-

   10 years 6 months ago [\#3099](#3099) by Blue Shadow  Replied by *Blue Shadow* on topic *[How to make a range gun available only in berserk](https://www.realm667.com/forum/the-workshop/586-how-to-make-a-range-gun-available-only-in-berserk#3099 "I am making a shotgun that shoots blasts of hellfire,but i want it to be available only in berserk mode(need berserk power to get the weapon ready,even if it is picked up).When i put the...")*

 Post your code so we can see what's wrong.

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

- **CaptainManiac**
- ![CaptainManiac's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar4791.png) Topic Author
- Cacodemon
- ![Cacodemon](https://www.realm667.com/media/kunena/ranks/rank_8_caco.png)

 Less More- Posts: 103
-
-
-
-

   10 years 6 months ago [\#3100](#3100) by CaptainManiac  Replied by *CaptainManiac* on topic *[How to make a range gun available only in berserk](https://www.realm667.com/forum/the-workshop/586-how-to-make-a-range-gun-available-only-in-berserk#3100 "I am making a shotgun that shoots blasts of hellfire,but i want it to be available only in berserk mode(need berserk power to get the weapon ready,even if it is picked up).When i put the...")*

Code:

ACTOR HellFireSG : Shotgun //2405 { Tag "HellFire Shotgun" +FLOORCLIP +NOGRAVITY +WEAPON.EXPLOSIVE +Weapon.AMMO_OPTIONAL +Weapon.DONTBOB +WEAPON.NOAUTOAIM Weapon.SelectionOrder 3000 Weapon.SlotNumber 3 //AttackSound "weapons/hfsgblast" //Inventory.Pickupsound "misc/hfsgpickup" Inventory.PickupMessage "You got the Hellfire shotgun.Liquidise with Hellfire!" Obituary "%k was liquidised by HellFire Shotgun" Scale 0.3 States { Spawn: HFSG ABC 8 BRIGHT Loop Ready: HFSG DE 2 A_WeaponReady loop } }

i wanted in the spawn state to be a_jumpifinventory("Powerstrenght",1,"Ready"),but it gave me that error and i deleted it

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

- **Blue Shadow**
- ![Blue Shadow's Avatar](https://www.realm667.com/media/kunena/core/svg/person.svg)
- Administrator
- ![Administrator](https://www.realm667.com/media/kunena/ranks/rank_20_barrel.png)

 Less More- Posts: 1131
-
-
-

   10 years 6 months ago [\#3101](#3101) by Blue Shadow  Replied by *Blue Shadow* on topic *[How to make a range gun available only in berserk](https://www.realm667.com/forum/the-workshop/586-how-to-make-a-range-gun-available-only-in-berserk#3101 "I am making a shotgun that shoots blasts of hellfire,but i want it to be available only in berserk mode(need berserk power to get the weapon ready,even if it is picked up).When i put the...")*

 Post the erroneous code. I don't see any A_JumpIfInventory calls there.

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

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

 Less More- Posts: 808
-
-
-
-

   10 years 6 months ago - 10 years 6 months ago [\#3105](#3105) by MagicWazard  Replied by *MagicWazard* on topic *[How to make a range gun available only in berserk](https://www.realm667.com/forum/the-workshop/586-how-to-make-a-range-gun-available-only-in-berserk#3105 "I am making a shotgun that shoots blasts of hellfire,but i want it to be available only in berserk mode(need berserk power to get the weapon ready,even if it is picked up).When i put the...")*

> CaptainManiac wrote: i wanted **in the spawn state** to be a\_jumpifinventory("Powerstrenght",1,"Ready"),but it gave me that error and i deleted it

That could be a problem right there. "Spawn" is the state in which the item exists in the game world to be picked up. At this point, the item isn't in the player's inventory, so checking the player's inventory for "PowerStrength" at that time wouldn't be meaningful--it'll never find it. You also misspelled "PowerStrength" in the excerpt above, which could also give you trouble if the misspelling was also in the original code. What you probably want to do is put the A_JumpIfInventory into the "Ready" state itself, and then make a similar state ("Berserk"? "Powered"?) that contains the weapon attack and readiness check. Something like so:
Code:

States { Spawn: HFSG ABC 8 BRIGHT Loop Ready: HFSG DE 2 A_JumpIfInventory("PowerStrength", 1, "Powered") //no attack function OR weapon readiness in this state loop Powered: HFSG DE 2 A_WeaponReady //attack function here loop } }

Bear in mind that I haven't tested this to see if it's airtight, but it gets the general point across.

 Last edit: 10 years 6 months ago by MagicWazard.

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

- **CaptainManiac**
- ![CaptainManiac's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar4791.png) Topic Author
- Cacodemon
- ![Cacodemon](https://www.realm667.com/media/kunena/ranks/rank_8_caco.png)

 Less More- Posts: 103
-
-
-
-

   10 years 6 months ago - 10 years 6 months ago [\#3106](#3106) by CaptainManiac  Replied by *CaptainManiac* on topic *[How to make a range gun available only in berserk](https://www.realm667.com/forum/the-workshop/586-how-to-make-a-range-gun-available-only-in-berserk#3106 "I am making a shotgun that shoots blasts of hellfire,but i want it to be available only in berserk mode(need berserk power to get the weapon ready,even if it is picked up).When i put the...")*

 Then i need to repair my sprites for ready or at least to put it in the powered mode,cus i put flame things on the ready animation to indicate that the weapon is active.YOU WILL SEE MY CRAP NOW.I CAN'T DRAW CORRECTLY AND BECAUSE OF THAT WEAPON WILL BE SIMILAR TO A JOKE WEAPON THAN LIKE A SAWED-OFF HELLISH SHOTGUN THAT FIREC CUSTOM SHOOTABLE BLASTS OF HELLFIRE.LOOK
PS:Sorry for the late reply,but yesterday was evening in my region and i was made to go to bed and today there was a work to do.

- [ HFSGD0.png ![HFSGD0.png](https://www.realm667.com/forum/attachment/224?download=1) ](https://www.realm667.com/forum/attachment/224?download=1 "HFSGD0.png") [ ](https://www.realm667.com/forum/attachment/224?download=1 "HFSGD0.png")
- [ HFSGE0.png ![HFSGE0.png](https://www.realm667.com/forum/attachment/225?download=1) ](https://www.realm667.com/forum/attachment/225?download=1 "HFSGE0.png") [ ](https://www.realm667.com/forum/attachment/225?download=1 "HFSGE0.png")

 Last edit: 10 years 6 months ago by CaptainManiac. Reason: I missed something

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

- **CaptainManiac**
- ![CaptainManiac's Avatar](https://www.realm667.com/media/kunena/avatars/resized/size144/users/avatar4791.png) Topic Author
- Cacodemon
- ![Cacodemon](https://www.realm667.com/media/kunena/ranks/rank_8_caco.png)

 Less More- Posts: 103
-
-
-
-

   10 years 6 months ago [\#3107](#3107) by CaptainManiac  Replied by *CaptainManiac* on topic *[How to make a range gun available only in berserk](https://www.realm667.com/forum/the-workshop/586-how-to-make-a-range-gun-available-only-in-berserk#3107 "I am making a shotgun that shoots blasts of hellfire,but i want it to be available only in berserk mode(need berserk power to get the weapon ready,even if it is picked up).When i put the...")*

 Thanks you

Please [Log in](https://www.realm667.com/component/users/login?return=aHR0cHM6Ly93d3cucmVhbG02NjcuY29tL2ZvcnVtL3RoZS13b3Jrc2hvcC81ODYtaG93LXRvLW1ha2UtYS1yYW5nZS1ndW4tYXZhaWxhYmxlLW9ubHktaW4tYmVyc2Vyaw==&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)
