I find this error odd, considering I use the function almost exactly the same somewhere else in my code. Here is the relevant code:
let fIDA = findObjs({ characterid: attacker.id, name: "fid"})[0]; //These two lines work perfectly fine
let UsesA = findObjs({ characterid: attacker.id, name: "repeating_weapons_"+fIDA.get("current")+"_Uses"},{ caseInsensitive: true })[0];
function DecUsesA() {
UsesA.setWithWorkers({current: Number(UsesA.get("current")) - 2})
}
And the full error I get is TypeError: UsesA.setWithWorkers is not a function
TypeError: UsesA.setWithWorkers is not a function
at DecUsesA (apiscript.js:298:23)
at apiscript.js:343:21
at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:65:16)
at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:70:8)
at /home/node/d20-api-server/api.js:1510:12
at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560
at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)
at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546)
at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489)
at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) I would appreciate some help; I'm pretty much completely confounded by this error.