
So, I'm new to API scripting and I ran into an issue that I can't seem to find an answer for. I am playing an Echo Knight fighter, and I want to be able to summon my "Echo" token onto the map, but the problem I am running into is that the Echo's AC is calculate using your character's proficiency bonus (Prof bonus + 14 to be exact) but I can't seem to get it to pull the pb from the character sheet. Currently, I just have to type in the total value for it (16), but I'd like for it to update as I level up. Any suggestions as to how I can do this? It would go into bar2. on("chat:message",function(msg){ if(msg.type=="api" && msg.content.indexOf("!echo")==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/158402412/SavO2bnpKaQ6z8eNffK1mg/thumb.png?159770993955" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/158402412/SavO2bnpKaQ6z8eNffK1mg/thumb.png?159770993955</a>", name:tok.get("name") + "'s Echo", controlledby:player.get("id"), light_radius:60, light_dimradius:-5, light_hassight:true, bar2_value:16, bar1_value:1, bar1_max:1 }); sendChat(tok.get("name"),"Manafested an Echo of himself."); spawnFx(tok.get("left")+70,tok.get("top"),"burn-charm",tok.get("pageid")); } });