and things are not going right. I did not change anything in my script but now it is not pulling the name from the token ids that are past to the script. When I log who, and whoTarg I just get "", and it tells me that selectedToken is undefined. But if I log selectedId I get the selected tokens id string so it is getting the raw data I am sending it, but then it isn't doing anything from there. on('chat:message', function(msg) {
if (msg.type != 'api') return;
var parts = msg.content.split(' ');
var command = parts.shift().substring(1);
if (command == 'test')
{
var selectedId = parts[0];
var targetId = parts[1];
//Get the token.id as tokens
var selectedToken = getObj('graphic', selectedId);
var targetToken = getObj('graphic', targetId);
//Get the Name of tokens
var whoName = selectedToken.get('name');
var whoTargName = targetToken.get('name');
var who = getObj('character', selectedToken.get('represents'));
var whoTarg = getObj('character', targetToken.get('represents'));
if (!who)
{
who = selectedToken.get('name');
}
if (!whoTarg)
{
whoTarg = targetToken.get('name');
}
}
});