I am having trouble with one of my players character sheet/token. I am using the D&D 5E by Roll20 character sheet along with the 5th Edition OGL by Roll20 Companion. I created a SFX spellbook for one my players Wizard PC. For this spell book I created a "Cloud of Daggers Spell sfx" using an API from a you tube video created by Nick Olivo. When I use the macro containing my "Cloud of Daggers API" with the Wizard character sheet/token the script and API, the API sandbox shuts down. When I use the macro containing my "Cloud of Daggers API" with other character sheets/tokens the script and API work just fine and the API sandbox does not shut down. I have run out ideas with my problem solving. Any Help would be appreciated. This is the API script I am using: on("ready",function() { on("chat:message",function(msg){ if(msg.type=="api" &&msg.content.indexOf("!cloudofdaggers")==0) { var selected = msg.selected; if (selected===undefined) { sendChat("API", "Please select a character."); return; } var tok = getObj("graphic",selected[0]._id); var character = getObj("character",tok.get("represents")); var player = getObj("player",character.get("controlledby")); createObj("graphic",{ left:tok.get("left")+70, top:tok.get("top"), height:70, width:70, pageid:tok.get("pageid"), layer:"objects", imgsrc:"<a href="https://s3.amazonaws.com/files.d20.io/images/335183605/aLBEcpRKn6mRQctaIrh69w/thumb.png?16802918135" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/335183605/aLBEcpRKn6mRQctaIrh69w/thumb.png?16802918135</a>", name:tok.get("name") + "'s Cloud of Daggers", controlledby:player.get("id"), aura1_square:true, aura1_radius:0, aura1_color:"#ff00ff", showplayers_aura1:true, }); sendChat(tok.get("name"),"summoned a cloud of daggers."); spawnFx(tok.get("left")+70,tok.get("top"),"bomb-magic",tok.get("pageid")); } }); }); This is the macro I use that calls the API Script: !cloudofdaggers &{template:npcaction} {{name=@{selected|character_name} ***Cloud of Daggers***}} {{description=**Spell Cast as Level ?{Level?|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9}** **Duration: Concentration Up to 1 minute** *You fill the air with spinning daggers in a cube 5 feet on each side, centered on a point you choose within range. A creature takes 4d4 slashing damage when it enters the spell’s area for the first time on a turn or starts its turn there.* **At Higher Levels:** *When you cast this spell using a spell slot of 3rd level or higher, the damage increases by 2d4 for each slot level above 2nd.*}} !modbattr --charid @{selected|character_id} --silent --lvl?{Level?}_slots_expended|-1!!! When ever I use the macro that includes this API script using the Wizard Character the sandbox shuts down and I get the following error: Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again. More info... If this script was installed from the Mod Library, you might find help in the Community API Forum. For reference, the error message generated was: TypeError: Cannot read properties of undefined (reading 'get') TypeError: Cannot read properties of undefined (reading 'get') at apiscript.js:30255:37 at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1762:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400