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

.controlledby undefined?

            case '!control-all':                     var m_obj = _.chain(msg.selected)  // Start a chain of the selected objects                   .map(function(s){                     return getObj('graphic',s._id);  // try to get each as a graphic (will be undefined for drawings, text, etc                   })                   .reject(_.isUndefined)  // Remove those selected objects that were not graphics (drawings, text, etc)                   .each(function(t){                     log('t.controlledby ' + t.controlledby);                   });                                   break;   "t.controlledby undefined" "t.controlledby undefined" "t.controlledby undefined" for object with or without controlling players PS: what I really want to do is a way to give all tokens "Controlled by All Players" in one fell swoop :)
1446718746
Lithl
Pro
Sheet Author
API Scripter
t is a Roll20 object, and controlledby is a property. Accessing the value of any property of a Roll20 object other than id  requires using the get() function. Try t.get('controlledby')  instead.
so true ^_^