Apologize if this is not the right place to post this, but I am trying to select two random events and play an animation using the following scripts (using MZ with Visustella plugins):
However, the animations are not firing and I get the following error message:
Most of the references to ".requestAnimation" I have found through google are MV-related, so I am wondering if this script call is no longer valid or have I just screwed up the syntax.
Thank you.
JavaScript:
const pevents = [12];
for (let i = 234; i < 251; i++) {
pevents.push(i);
}
var p = pevents[Math.floor(Math.random()*pevents.length)];
var character = $gameMap.event(p);
character.requestAnimation(191);
const eevents = [2];
for (let i = 163; i < 180; i++) {
eevents.push(i);
}
var e = eevents[Math.floor(Math.random()*eevents.length)];
var character = $gameMap.event(e);
character.requestAnimation(190);
However, the animations are not firing and I get the following error message:
Most of the references to ".requestAnimation" I have found through google are MV-related, so I am wondering if this script call is no longer valid or have I just screwed up the syntax.
Thank you.