Here is a minimal testcase: var test = test || {
a: 0,
counter: 0,
job: 0,
myFunction: function () {
sendChat("gm", "creating object");
var page = Campaign().get("playerpageid");
test.a = createObj("text", {
text: "aaa",
font_size: 200,
pageid: page,
layer: "map",
top: 200,
left: 500,
font_family: "contrail"
});
setTimeout(test.myFunction2, 1000);
},
myFunction2: function() {
sendChat("gm", "removing object");
test.a.remove();
test.job = setInterval(test.myFunction3, 2000);
},
myFunction3: function() {
sendChat("gm", "changing object");
if (test.couter < 10) {
clearInterval(test.job);
}
var str = "";
for (i = 0; i < test.counter; i++) { str += "bugbugbug"; }
test.a.set("text", str);
test.counter++;
},
register: function () {
test.myFunction();
}
};
on("ready", function(){ test.register(); }); The most obvious guess is that roll20 is not correctly tracking objects that have been deleted.