vÍnce said: Hi John M. roll20 sheets are not like working with general webpages. There are many things (specifically anything DOM related) that will not work in roll20. <a href="https://wiki.roll20.net/Sheet_Worker_Scripts" rel="nofollow">https://wiki.roll20.net/Sheet_Worker_Scripts</a> All js must be embedded within <script type="text/worker"> to function. You will need to use on(change) events to trigger workers, getAttrs to grab attribute data and setAttrs to write attribute data. If you would like to learn more or better examples than what's on the wiki, I would highly recommend this site: <a href="https://cybersphere.me/sheet-workers-automating-the-sheet/" rel="nofollow">https://cybersphere.me/sheet-workers-automating-the-sheet/</a> (created by a pillar in the roll20 community. GiGs ) see if this works (untested, but it should get you started); <script type="text/worker"> on('change:nivel', () => { getAttrs(['nivel'], (v) => { const output = {}; const nivelSelect = +v.nivel; const nivelSelecionado = nivelSelect; const valores = nivelSelecionado.split(','); const xpTotal = valores[1]; // Atualizar o valor do campo "attr_xptotal" output.xptotalInput = xpTotal; setAttrs(output, {silent: true}); }); }); </script> Also, you should change the disabled input to readonly. <input class="W-100 text-box text-low-2 text-center text-bold" type="text" name="attr_xptotal" id="xptotal" disabled="disabled"/> to <input class="W-100 text-box text-low-2 text-center text-bold" type="text" name="attr_xptotal" id="xptotal" readonly /> Workers can have a problem writing to a disabled field. <a href="https://cybersphere.me/the-disabled-attribute/" rel="nofollow">https://cybersphere.me/the-disabled-attribute/</a> Cheers Good evening Vínce, thank you very much for your help. I had to spend some time testing and refining until it really worked. The code ended up like this: <span style="display:inline-block; margin-bottom:0px" class="W-100 text-bold text-normal text-center text-left"> Nivel</span> <span> <select style="margin-bottom:0px" class="W-100 text-box text-low-2 text-center" name="attr_nivel" id="nivel"> <option value="1,0,100">1</option> <option value="2,100,200">2</option> <option value="3,300,300">3</option> <option value="4,600,400">4</option> <option value="5,1000,600">5</option> <option value="6,1600,800">6</option> <option value="7,2400,1200">7</option> <option value="8,3600,1500">8</option> <option value="9,5100,2000">9</option> <option value="10,7100,3000">10</option> </select> </span><br> <span style="display:inline-block; margin-bottom:0px" class="W-100 text-bold text-normal text-center text-left"> Xp Atual</span> <input class="W-100 text-box text-low-2 text-center text-bold" type="text" name="attr_xp" id="xp" value="0"/><br> <span style="display:inline-block; margin-bottom:0px" class="W-100 text-bold text-normal text-center text-left"> Xp Necessario</span> <input class="W-100 text-box text-low-2 text-center text-bold" name="attr_xpnecessario" id="xpnecessario" readonly /> <span style="display:inline-block; margin-bottom:0px" class="W-100 text-bold text-normal text-center text-left"> Xp Total</span> <input class="W-100 text-box text-low-2 text-center text-bold" name="attr_xptotal" id="xptotal" readonly /> <script type="text/worker"> on('change:nivel change:xp', (event) => { console.log('Teste: 1'); getAttrs(['nivel', 'xp'], (v) => { console.log('Teste: 2'); const output = {}; console.log('v.nivel:', v.nivel); const nivelValue = +v.nivel || 0; const xpAtual = +v.xp || 0; const valores = v.nivel.split(',').map(str => str.trim()); if (valores.length === 3) { const xpTotal = valores[1]; const xpNecessario = valores[2]; console.log('xpTotal:', xpTotal); console.log('xpNecessario:', xpNecessario); // Atualizar o valor do campo "attr_xptotal" output.xptotal = (parseInt(xpTotal) + xpAtual).toString(); // Atualizar o valor do campo "attr_xpnecessario" output.xpnecessario = (parseInt(xpNecessario) - xpAtual).toString(); setAttrs(output, () => { console.log('Campos xptotal, xpnecessario e diferencaxp atualizados.'); }); } else { console.log('Valores não contém exatamente três elementos.'); } }); }); </script> However, I'm still having a problem where 'output.xptotal' is only updating when I reload the sheet, and 'output.xpnecessario' is updating with any modification. Why might this be happening? I would like both to be updated after any modification.