It's a simple change. Just add a new script in your game with the following code. I will post a step-by-step with images after the code for you to follow if you don't know what I mean. var handledeathsave = function(msg,character) {
var result = msg.inlinerolls[0].results.total ? msg.inlinerolls[0].results.total : false;
var resultbase = msg.inlinerolls[0].results.rolls[0].results[0].v ? msg.inlinerolls[0].results.rolls[0].results[0].v : false;
var resultoutput = "";
if(result === false) {
log("FAILED TO FIND DEATH SAVE ROLL RESULT");
}
else if(resultbase === 20) {
resultoutput = "CRITICAL SUCCESS: 1HP";
var hp = findObjs({type: 'attribute', characterid: character.id, name: "hp"}, {caseInsensitive: true})[0];
if(!hp) {
createObj("attribute", {name: "hp", current: 1, max: "", characterid: character.id});
}
else {
hp.set({current:1});
}
cleardeathsaves(character);
}
else if(result < 15 || resultbase === 1) {
var fail1 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_fail1"}, {caseInsensitive: true})[0];
var fail2 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_fail2"}, {caseInsensitive: true})[0];
var fail3 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_fail3"}, {caseInsensitive: true})[0];
if(!fail1) {
fail1 = createObj("attribute", {name: "deathsave_fail1", current: "0", max: "", characterid: character.id});
//var fail1 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_fail1"}, {caseInsensitive: true})[0];
}
if(!fail2) {
fail2 = createObj("attribute", {name: "deathsave_fail2", current: "0", max: "", characterid: character.id});
//var fail2 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_fail2"}, {caseInsensitive: true})[0];
}
if(!fail3) {
fail3 = createObj("attribute", {name: "deathsave_fail3", current: "0", max: "", characterid: character.id});
//var fail3 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_fail3"}, {caseInsensitive: true})[0];
}
if(fail2.get("current") === "on" || (fail1.get("current") === "on" && resultbase === 1)) {
fail3.set({current:"on"});
resultoutput = "DECEASED";
cleardeathsaves(character);
}
else if(fail1.get("current") === "on" || resultbase === 1) {
fail2.set({current:"on"});
resultoutput = "FAILED 2 of 3";
}
else {
fail1.set({current:"on"});
resultoutput = "FAILED 1 of 3";
}
}
else {
var succ1 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_succ1"}, {caseInsensitive: true})[0];
var succ2 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_succ2"}, {caseInsensitive: true})[0];
var succ3 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_succ3"}, {caseInsensitive: true})[0];
if(!succ1) {
succ1 = createObj("attribute", {name: "deathsave_succ1", current: "0", max: "", characterid: character.id});
//var succ1 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_succ1"}, {caseInsensitive: true})[0];
}
if(!succ2) {
succ2 = createObj("attribute", {name: "deathsave_succ2", current: "0", max: "", characterid: character.id});
//var succ2 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_succ2"}, {caseInsensitive: true})[0];
}
if(!succ3) {
succ3 = createObj("attribute", {name: "deathsave_succ3", current: "0", max: "", characterid: character.id});
//var succ3 = findObjs({type: 'attribute', characterid: character.id, name: "deathsave_succ3"}, {caseInsensitive: true})[0];
}
if(succ2.get("current") === "on") {
succ3.set({current:"on"});
resultoutput = "STABILIZED";
cleardeathsaves(character);
}
else if(succ1.get("current") === "on") {
succ2.set({current:"on"});
resultoutput = "SUCCEEDED 2 of 3";
}
else {
succ1.set({current:"on"});
resultoutput = "SUCCEEDED 1 of 3";
}
}
if(state.FifthEditionOGLbyRoll20.deathsavetracking != "quiet") {
if(getAttrByName(character.id, "wtype") === "") {
sendChat(msg.who, "<div class='sheet-rolltemplate-simple' style='margin-top:-7px;'><div class='sheet-container'><div class='sheet-label' style='margin-top:5px;'><span>" + resultoutput + "</span></div></div></div>");
}
else {
sendChat(msg.who, "/w gm <div class='sheet-rolltemplate-desc'><div class='sheet-desc'><div class='sheet-label' style='margin-top:5px;'><span>" + resultoutput + "</span></div></div></div>");
}
}
};