So I'm trying to learn JavaScript, and I'm using a third party system called a Resolve Pool instead of inspiration in my 5e game. I'm trying to write some code to hold the info in a token on the Landing page, then add or subtract from the value as I see fit. I wrote something that doesn't work, trying to modify from a Nick Olivo video based on what I've put together from SkillShare. Needless to say, It doesn't work yet. Right now I just want to get the counting working, then I'll worry about accessing the tokens for data. on("chat:message", function(msg) { if (msg.type == "api" && msg.content.indexOf("!resolve") ==0){ var args = msg.content.split(/\s+/); var isModified = args[1]; var modifierNumber = Number(args[2]); var resolveDice = 0 while(arg[1] == true){ resolveDice + modifierNumber; sendChat("I now have " + resolveDice + " Resolve.") } while(resolveDice>=6){ sendChat("Resolve","I feel full of Resolve!") } while(resolveDice<=0){ sendChat("Resolve","I have no Resolve.") } } }); What I want this code to do is check the chat input for !resolve, followed by a true or false, followed by a number. When true, I want it to add or subtract the number given and output a message. When false, I want it to output just the number of Resolve Dice. Any Suggestions?