A_SelectWeapon
From ZDoom Wiki
A_SelectWeapon (string type)
Selects the specified weapon type as the calling player's current weapon. The specified type has to be a valid weapon and the weapon must be present in the player's inventory or nothing will happen. The function will be carried out whether or not the weapon has ammo.
This function can only be called from weapons or custom inventory items.
Examples
This new Berserk powerup uses A_SelectWeapon to change to a new unarmed attack which replaces the fist.
ACTOR NewBerserk : Berserk replaces Berserk
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("PowerStrength")
TNT1 A 0 HealThing(100, 0)
TNT1 A 0 A_SelectWeapon("KoolFist")
stop
}
}

