So I'm using this script to store the position of the zombie: on('ready', function(){
"use strict";
on('change:graphic',function(obj,prev){
if( ( _.contains(['gmlayer','objects'],obj.get('layer')) ) &&
( obj.get('left') !== prev.left || obj.get('top') !== prev.top) &&
obj.get('represents') ) {
let a=_.chain(findObjs({type: 'attribute',characterid: obj.get('represents')}))
.filter(a=>a.get('name').match(/^position-[xy]$/))
.each(a=>{
switch(a.get('name')){
case 'position-x':
a.set({current: obj.get('left')});
break;
case 'position-y':
a.set({current: obj.get('top')});
break;
}
});
}
});
});
And moving the corpse to them like this: !token-mod --set top|[[@{Burnt Zombie 5|position-y}]] left|[[@{Burnt Zombie 5|position-x}]] --ids -L8pWFs3MI1asfUPcMEK Now all I need to finish what I'm trying to accomplish is a way to do conditional statements. if (zombie-hp < 1)
move corpse to zombie X/Y
move zombie to gm layer
move corpse to object layer
Anyone know of any scripts that will allow me to do conditional statements?