
Hello, I'm using a Rollable Table in my script that automates combat. There is a point where, once the attacker hits his target, I have to check where the blow lands. I created a locations table (calles locs) with 10 items in it. It works pretty well, but when I call it within the script, the code following the function is executed before the sendChat returns. My function is sendChat(attackerName, "/roll 1t[locs]", function(ops) { var rollresult = JSON.parse(ops[0].content); loc = rollresult.rolls[0].results[0]; }); And straight after that I need to use the loc variable (that is initialized outside). Unfortunately it seems that the code following the sendChat uses the variable BEFORE the sendChat function has done its job. Logging inside and outside it, in the scripts log I can see the log outside the function before the one inside it. Any hints? Thanks