I'm new to javascript, as well as to roll20. I'm attempting to make a script that after typing !Turn into the chat bar, will shoot out the maximum number of HD that a cleric can turn based off of the d20, charisma modifier, and a +2 bonus to his knowledge religion ranks of 5 or more. I have had some issues finding the exact answer in the forums. var character = getObj("character", "Traovepo"); getAttrByName("Traovepo", "cha-mod"); getAttrByName("Traovepo", "level"); var chaMod = getAttrByName("Traovepo", "cha-mod"); var clericLevel = getAttrByName("Traovepo", "level"); var dice = Math.floor((Math.random() * 20) + 1); on("chat:message", function(msg) { if (msg.type == "api" && msg.content.indexOf("!Turn") !== -1) { if (dice + chaMod + 2 <= 0) {sendChat("Max HD Affected: " + clericLevel -4)} if (dice + chaMod + 2 == 1||2||3) {sendChat("Max HD Affected: " + clericLevel - 3)}; if (dice + chaMod + 2 == 4||5||6) {sendChat("Max HD Affected: " + clericLevel - 2)}; if (dice + chaMod + 2 == 7||8||9) {sendChat("Max HD Affected: " + clericLevel - 1)}; if (dice + chaMod + 2 == 10||11||12) {sendChat("Max HD Affected: " + clericLevel)}; if (dice + chaMod + 2 == 13||14||15) {sendChat("Max HD Affected: " + clericLevel + 1)}; if (dice + chaMod + 2 == 16||17||18) {sendChat("Max HD Affected: " + clericLevel + 2)}; if (dice + chaMod + 2 == 19||20||21) {sendChat("Max HD Affected: " + clericLevel + 3)}; if (dice + chaMod + 2 >= 22) {sendChat("Max HD Affected: " + clericLevel + 4)}; } }); my test character's name is Traovepo. I'm sure there are multiple syntax errors, but the one that I'm getting snagged on at the moment is the following error messages "Invalid character_id Traovepo for getAttrByName()" "Invalid character_id Traovepo for getAttrByName()" "Invalid character_id Traovepo for getAttrByName()" I'm trying to use the character sheet to call the Cha-mod, Level so that when the player types "!Turn" it automates everything and sends a chat of the maximum number of Hit Die he can affect. All rules based off of D&D 3.5 Thanks in advance for your assistance