short EquipACRfloat ACRconditionref PlayerEquippedACRbegin ScriptEffectStart ; Check to see if player has ACR equipped in Object slot #5 set EquipACR to 0 if player.IsWeaponInList ACROrderedList set PlayerEquippedACR to Player.GetEquippedObject 5 set EquipACR to 1 endif if EquipACR == 1 ; Gets condition of equipped ACR set ACRcondition to player.GetEquippedCurrentHealth 5 set ACRcondition to ACRcondition / GetHealth PlayerEquippedACR if PlayerEquippedACR == ZLACRBar105 player.removeitem ZLACRBar105 1 1 player.AddItemHealthPercent ZLACRStripped 1 ACRcondition 1 player.additem ZLACRBar105BarrelKit 1 1 player.additem ZLACRIronSightKit 1 1 player.additem ZLACRSuppressorKit 1 1 player.additem ZLACRCamoBlackKit 1 1 elseif PlayerEquippedACR == ZLACRBar105ACOG player.removeitem ZLACRBar105ACOG 1 1 player.AddItemHealthPercent ZLACRStripped 1 ACRcondition 1 player.additem ZLACRBar105BarrelKit 1 1 player.additem ZLACRACOGKit 1 1 player.additem ZLACRSuppressorKit 1 1 player.additem ZLACRCamoBlackKit 1 1 [ the script continues with all permutations of the weapon] endif endifendbegin ScriptEffectFinish if EquipACR == 0 ShowMessage ZLACREquipError player.additem ZLACRBreakdown 1 endifend
PrintToConsole "Line X is running"; OrDebugPrint "Line X is running"If you use http://fose.silverlock.org/fose_command_doc.html#DebugPrint, you'll also need to use http://fose.silverlock.org/fose_command_doc.html#SetDebugMode in order for the messages to be printed to the console.
DebugPrint "The condition of the player's weapon, %n, is %f" PlayerEquippedACR ACRcondition
begin ScriptEffectStart ; Check to see if player has ACR equipped in Object slot #5 set EquipACR to 0 PrintToConsole "EquipACR to 0 is running" if player.IsWeaponInList ACROrderedList set PlayerEquippedACR to Player.GetEquippedObject 5 set EquipACR to 1 endif PrintToConsole "EquipACR to 1 is running" if EquipACR == 1 ; Gets condition of equipped ACR set ACRcondition to player.GetEquippedCurrentHealth 5 set ACRcondition to ACRcondition / GetHealth PlayerEquippedACR PrintToConsole "set ACRcondition is running" if PlayerEquippedACR == ZLACRBar105 player.removeitem ZLACRBar105 1 1 player.AddItemHealthPercent ZLACRStripped 1 ACRcondition 1 player.additem ZLACRBar105BarrelKit 1 1 player.additem ZLACRIronSightKit 1 1 player.additem ZLACRSuppressorKit 1 1 player.additem ZLACRCamoBlackKit 1 1.....