I tried that here is fixbayoneta pretty sure that's what you meant?
(item_set_slot,"itm_british_brown_bess_bare",slot_item_bayonetItem,"itm_british_brown_bess"), #set each non-bayoneted rifle to its bayoneted version
(item_set_slot,"itm_british_brown_bess",slot_item_bayonetItem,"itm_british_brown_bess_bare"), #set each bayoneted rifle to its non-bayoneted version
(item_set_slot, "itm_british_brown_bess", slot_item_isFixed, 1), #set each bayonet-attached item to isFixed
(item_set_slot,"itm_french_charleville_bare",slot_item_bayonetItem,"itm_french_charleville"), #set each non-bayoneted rifle to its bayoneted version
(item_set_slot,"itm_french_charleville",slot_item_bayonetItem,"itm_french_charleville_bare"), #set each bayoneted rifle to its non-bayoneted version
(item_set_slot, "itm_french_charleville", slot_item_isFixed, 1), #set each bayonet-attached item to isFixed
(item_set_slot,"itm_british_baker_rifle",slot_item_unique_bayonet,"itm_british_baker_rifle_bayonet"), #set each non-bayoneted rifle to its bayoneted version
(item_set_slot,"itm_british_baker_rifle_bayonet",slot_item_unique_bayonet,"itm_british_baker_rifle"), #set each bayoneted rifle to its non-bayoneted version
(item_set_slot, "itm_british_baker_rifle_bayonet", slot_item_isFixed, 1), #set each bayonet-attached item to isFixed
(eq,":bayonetCooldown",0),
(agent_get_wielded_item,":curRifle",":playerAgent"),
(item_get_slot,":bayonetItem",":curRifle",slot_item_bayonetItem),
(item_get_slot,":bayonet",":curRifle", slot_item_unique_bayonet),
(assign, ":bayonet", "itm_british_baker_bayonet"),
(neq,":bayonetItem",0),
Thanks this worked I've also tried your first script with the unequipping the bayonet sabre but it causes the same problem as before with it playing the only one animation and it also doesn't unequip the saber bayonet here is the combined script for them both.
#Bajo script
(eq, ":event_type", multiplayer_event_fixBayonet),
(store_script_param,":eventNo",3),
(store_script_param,":var2",4),
(try_begin),
(eq,":eventNo",1), #Event 1 - Fix Bayonet
(assign, ":bayonet", "itm_british_baker_bayonet"),
(assign,":itemFound",0),
(assign,":playerAgent",":var2"),
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_get_slot,":bayonetCooldown",":playerAgent",slot_agent_bayonetCooldown),
(eq,":bayonetCooldown",0),
(agent_get_wielded_item,":curRifle",":playerAgent"),
(item_get_slot,":bayonetItem",":curRifle",slot_item_bayonetItem),
(neq,":bayonetItem",0),
(try_for_range,":curSlot",0,3),
(neq,":itemFound",1),
(agent_get_item_slot,":curItem",":playerAgent",":curSlot"),
(try_begin),
(eq,":curItem",":curRifle"),
(assign,":itemFound",1), #break loop
(assign,":itemSlot",":curSlot"),
(else_try),
(eq,":curItem",":bayonet"),
(assign, ":bayonet_in_inventory", 1),
(assign, ":bayonet_itemSlot", ":curSlot"),
(try_end),
(try_end),
(eq,":itemFound",1), #the item was found and no witchcraft occurred
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_get_ammo_for_slot,":rifleAmmo",":playerAgent",":itemSlot"),
(agent_get_slot,":isFixed",":playerAgent",slot_item_isFixed),
(try_begin),
(eq,":isFixed",0),
(eq,":bayonet_in_inventory",1),
(agent_set_animation,":playerAgent","anim_fix_bayonet"),
(agent_set_slot,":playerAgent",slot_item_isFixed, 1), # 1 marks the bayonet as fixed
(agent_unequip_item, ":playerAgent", ":bayonet", ":bayonet_itemSlot"),
(else_try),
(agent_set_animation,":playerAgent","anim_unfix_bayonet"),
(agent_set_slot,":playerAgent",slot_item_isFixed, 0), # 0 marks the bayonet as unfixed
(agent_equip_item, ":playerAgent", ":bayonet"),
(try_end),
(agent_unequip_item,":playerAgent",":curRifle"),
(agent_equip_item,":playerAgent",":bayonetItem"),
(agent_set_wielded_item,":playerAgent",":bayonetItem"),
(try_begin),
(eq,":rifleAmmo",0),
(agent_set_ammo,":playerAgent",":bayonetItem",0),
(try_end),
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_set_slot,":playerAgent",slot_agent_bayonetCooldown,6), #unable to spam bayonet on/off
(try_end), #Bajo script
That didn't work, Here is my script so far without your update, If possible could you take a look at it thanks
#Bajo script
(eq, ":event_type", multiplayer_event_fixBayonet),
(store_script_param,":eventNo",3),
(store_script_param,":var2",4),
(try_begin),
(eq,":eventNo",1), #Event 1 - Fix Bayonet
(assign,":itemFound",0),
(assign,":playerAgent",":var2"),
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_get_slot,":bayonetCooldown",":playerAgent",slot_agent_bayonetCooldown),
(eq,":bayonetCooldown",0),
(agent_get_wielded_item,":curRifle",":playerAgent"),
(item_get_slot,":bayonetItem",":curRifle",slot_item_bayonetItem),
(neq,":bayonetItem",0),
(try_for_range,":curSlot",0,3),
(neq,":itemFound",1),
(agent_get_item_slot,":curItem",":playerAgent",":curSlot"),
(eq,":curItem",":curRifle"),
(assign,":itemFound",1), #break loop
(assign,":itemSlot",":curSlot"),
(try_end),
(eq,":itemFound",1), #the item was found and no witchcraft occurred
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_get_ammo_for_slot,":rifleAmmo",":playerAgent",":itemSlot"),
(agent_get_slot,":isFixed",":playerAgent",slot_item_isFixed),
(try_begin),
(eq,":isFixed",0),
(agent_set_animation,":playerAgent","anim_fix_bayonet"),
(else_try),
(agent_set_animation,":playerAgent","anim_unfix_bayonet"),
(try_end),
(agent_unequip_item,":playerAgent",":curRifle"),
(agent_equip_item,":playerAgent",":bayonetItem"),
(agent_set_wielded_item,":playerAgent",":bayonetItem"),
(try_begin),
(eq,":rifleAmmo",0),
(agent_set_ammo,":playerAgent",":bayonetItem",0),
(try_end),
(agent_is_active, ":playerAgent"),
(agent_is_alive, ":playerAgent"),
(agent_set_slot,":playerAgent",slot_agent_bayonetCooldown,6), #unable to spam bayonet on/off
(try_end), #Bajo script
(else_try),
Ive narrowed it down and im 90 percent sure the issue is with the script which is exactly as in the tutorial i linked
Hi thanks for replying ill try your updated code later today although im haveing problems with the animation it only plays the fix bayonet animation and not the unfix one would you know the cause of this by any chance and again thanks for replying
#partizani ["russian_partizan","Partizani","Partisan Irregulars",tf_guarantee_all,0,0,fac_russia, [itm_rus_partizan1,itm_rus_partizan2,itm_rus_militia_ranker_pants,itm_rus_militia_ranker_pants1,itm_rus_opol_hat_ranker,itm_rus_partisan_hat1,itm_rus_partisan_hat2,itm_rus_partisan_hat3,itm_rus_partisan_hat4,itm_rus_partisan_hat5,itm_rus_opol_hat_ranker,itm_rus_drummer_shako,itm_bullets,itm_russian_dragoon_musket,itm_russian_peasant_fork,itm_russian_peasant_pitchfork,itm_russian_peasant_sap,itm_russian_peasant_kosa,itm_russian_peasant_kosa2,itm_birch_trunk,itm_brokenbottle,itm_russian_peasant_club,itm_russian_peasant_birch_club,itm_russian_peasant_axe,itm_russian_peasant_knife,itm_russian_peasant_serp,itm_russian_peasant_pike,itm_russian_peasant_kuvalda,itm_russian_peasant_2handed_axe,itm_russian_peasant_rogatina,itm_russian_gusarskiy_karabin], def_attrib_multiplayer|level(20),wpex(80,5,80,5,130,80),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_3,swadian_face_middle_1, swadian_face_old_2], #my troop: ["Militia_rebels","militia rebels","rebels",tf_guarantee_all,0,0,fac_austria, [itm_militia_rebel_coat,itm_rebel_hat,itm_prussian_landwehr_pants,itm_russian_peasant_sap,itm_russian_peasant_kosa,itm_russian_peasant_kosa2,itm_russian_peasant_pike,itm_russian_peasant_rogatina,itm_russian_cossack_pike,itm_russian_opolcheniye_pike], def_attrib_multiplayer|level(20),wpex(50,5,130,5,300,5),knows_common|knows_ironflesh_3|knows_power_strike_3|knows_athletics_10,swadian_face_middle_1, swadian_face_old_2], |