The Aaron said: Here ya go! For something like this, I suggest copying your Game and trying it on a copy first just to make sure you like the results. I tried it on my test game and it ran pretty well. 120 NPCs in about 5-10 seconds. To use it, just run: !fix-npcs It will tell you how man it's fixing so you know what to expect, then it will tell you when it's done. Cheers! Script Code: on('ready',()=>{
const fixMap = {
npc_name_flag: ()=>0,
rtype: ()=>"[{{always=1}} {{r2=[[1d20]",
wtype: ()=>"",
dtype: ()=>"full"
};
const fixChar = (id) => Object.keys(fixMap)
.forEach(a=>(findObjs({
type: "attribute",
characterid: id,
name: a
})[0]||{set:()=>{}}).set("current",fixMap[a](id)));
on('chat:message', (msg) => {
if('api' === msg.type && playerIsGM(msg.playerid) && /^!fix-npcs(\b\s|$)/i.test(msg.content)){
let who = (getObj('player',msg.playerid)||{get:()=>'API'}).get('_displayname');
let npcIds = (findObjs({
type: "attribute",
name: "npc",
current: "1"
})||[]).map(a=>a.get('characterid'));
sendChat('',`/w "${who}" Fixing ${npcIds.length} NPCs.`);
const burndown = ()=>{
if(npcIds.length){
let id = npcIds.shift();
fixChar(id);
setTimeout(burndown,0);
} else {
sendChat('',`/w "${who}" Finished updating NPCs.`);
}
};
burndown();
}
});
});
Thanks for helping me with this Aaron. However, the NPC NAME IN ROLLS is still set to SHOW Evan