I'm trying to write a sheet worker script for whenever a character levels to level 10 (via the attribute @{Level}), it sets 1 as the attribute value for @{Level10}. But nothing I do is working correctly. This is what I have, and it's not affecting it any. I'm not even sure if I'm on the right path. Perhaps someone could steer me the right way? <script type="text/worker">
on("change:level ", function() {
getAttrs(["level"], function(values) {
if(values.level == '10' ){setAttrs({level10: 1)});} else
if(values.level == '<10' ){setAttrs({level10: 0) });}
});
});
</script>