Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Grey_Wolf

A_SelectWeapon not working

Recommended Posts

Hello there! I'm  new here and still learning the basics of scripting, so I'm very inexperienced right now.

What I'm trying to do is to make the player switch from a weapon to another while pressing a button, but only if the player is currently holding a specific weapon at that time.

Thing is that A_SelectWeapon doesn't seem to work in my actor.

 

Spoiler

ChangeWeapon:
        TNT1 A 0 A_TakeInventory("Change", 1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_Takeinventory("ADSmode",1)
        TNT1 A 0 A_JumpIfInventory("AmmoSlug", 1, "SlugSwitch")
        Goto NoUpgrades

 

     NoAmmo:
        TNT1 A 0 A_Print("You have no slug rounds.", 2)
        SHTN A 3
        Goto Ready
    
     SlugSwitch:
        TNT1 A 0 A_Print("Slug rounds loaded", 2)
        TNT1 A 0 A_SelectWeapon("SlugShotgun")
        Stop
        
    }
}

 

When I press the button defined by that "Change", the message "slug rounds loaded" actually appears, so that part is working as intended. But as for the weapon switch, the player just remains stuck with no weapons in his hands and unable to switch even to normal weapons. I tried to change "SlugShotgun" with other pre-existing and working weapons, but the same issue is present. Any advice?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×