Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[HELP] "setWithWorkers" is not a function?

1515693720
Missingquery
Pro
Sheet Author
API Scripter
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.
stand by for the Arrival of The AAron or other Script wizard but my guess is UsesA may only be allowed to be used once.
1515697644
Lithl
Pro
Sheet Author
API Scripter
The function is setWithWorker, not setWithWorker s