G'day again, I'm looking for some guidance on how to get my new weapon that has been picked up to display, as oppose to the first weapon being displayed and the rest moving into the inventory. I've added the showplrweapon command when a player swaps with a weapon on the ground, however it won't display the newly picked up weapon.
;Artificial Intelligence Script
;Header - 2 Weapons Only script by Combollian. V 1.1
;desc = Only allowed two weapons at a time - This script is designed to only allow the player to have no more than 2 weapons at a time
;ensure that you add the dimvar=WeaponCount and setvar=WeaponCount=0 in the setup level file
;Triggers
;Set Variable to WeaponCount
:state=0:dimvar=WeaponCount,setvar=WeaponCount
;Set HUDs to display when active
:state=0,varequal=WeaponCount 2,plrdistwithin=30:state=1,hudreset,hudx=50,hudy=85,hudsize=18,hudtext=Press 'Enter' to Swap Weapons,hudname=weapon_swap_press,hudhide=1,hudmake=display
:state=0,varless=WeaponCount 2,plrdistwithin=30:state=2,hudreset,hudx=50,hudy=85,hudsize=18,hudtext=Press 'Enter' to Take Weapon,hudname=weapon_take_press,hudhide=1,hudmake=display
:state=0,vargreater=WeaponCount 2:preventplrselectinggun=1
:state=0,varequal=WeaponCount 2:preventplrselectinggun=0
;Check to see if more than 2 weapons, display weapon swap HUD if correct, then remove that weapon, take the new weapon and start script again.
:state=1,plrdistwithin=40:hudshow=weapon_swap_press,hudfadeout=weapon_swap_press
:state=1,varequal=WeaponCount 2,plrdistwithin=30,scancodekeypressed=28:state=3,plrsound=audiobank\items\pickup.wav,removecurrentweapon,subvar=WeaponCount 1
:state=3,varless=WeaponCount 2,plrusingaction=1:state=0,showplrweapon,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,addvar=WeaponCount 1
;Check to see if less than 2 weapons and display weapon take HUD if correct, then pick up new weapon after key pressed and start script again.
:state=2,plrdistwithin=40:state=4,hudshow=weapon_take_press,hudfadeout=weapon_take_press
:state=4,varless=WeaponCount 2,plrdistwithin=30,scancodekeypressed=28:state=0,showplrweapon,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,addvar=WeaponCount 1
;End of Script