Can some one explain this script to me please?

Hi there.

I did stumble over this old thread while looking for a way to use actors as event graphics. There apparently is a way:

var actor = $gameActors.actor(1); // Or whatever actor you want.var event = $gameMap.event(1); // Or whatever event you want.event.setImage(actor.characterName(), actor.characterIndex());

However I cannot get this to work. Could some one please explain to me how to use this?
Or if some one knows a plugin that does the same I would like it even more, I did try this but it glitches out when updating the actor graphics .
That is because an old forum update broke the code tag, compressing all scripts into one-liners. And you added the required line breaks in the wrong positions.

Untested, originally it should have been something like this:
Code:
var actor = $gameActors.actor(1);  // Or whatever actor you want.
var event = $gameMap.event(1);     // Or whatever event you want.
event.setImage(actor.characterName(), actor.characterIndex());
Thank you kindly for the reply. Works like a charm. Thread can be closed if need be.
@ziacer When you want a thread closed, please Report your opening post and ask for it to be closed. That is because Mods may not see an individual post, but will see a Report.
Thanks.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/can-some-one-explain-this-script-to-me-please.89222/