My "COFantasy" script is about 4000 lines of code, so I tried again with a simpler script: on("chat:message", function (msg) { "use strict"; if (msg.type != "api" || msg.content != "!foudn") return; var characters = findObjs({_type:'character'}); if (characters.length > 0) { var charId = characters[0].id; getAttrByName(charId, "repeating_armes_$0_armenom"); log("Weapon found"); } else { log("No character"); } }); Here is usage that results in the "foudn" message: