setTransparent() doesn't work

I tried to make my npc transparent with script calls, and found the script in RPG Maker MZ Script Call Reference, but this didn't work. Can anyone tell me how I can correct it?

$gameMap.event(this.eventId()).setTransparent()

I know I can use $gameMap.event(this.eventId()).setOpacity(0) to accomplish it, but I would like to learn more about script calls.
BTW, I didn't find a script call to setUntransparent. Is there one existing?

Any help is appreciated. Thank you in advance.
Note that you can also do this using the Transparent ON/OFF move route commands.

The correct script call syntax is setTransparent(true) (ON) or setTransparent(false) (OFF). 👋

For your example, try one of these:

this.character(0).setTransparent(true);
$gameMap.event(this.eventId()).setTransparent(true);
(Character ID 0 is "This Event" as used in event commands.)

Edit: I checked to make sure, and the MV / MZ Script Call List has the correct information for this.
Ah, thank you so much, Caethyril!
Now it works perfectly.

The list I've checked is this one.

It only says:
[TABLE]
[TR]
[TD]$gameMap.event(id).setTransparent()[/TD]
[TD]Sets an event to transparent[/TD]
[/TR]
[/TABLE]

It's a little confusing to have multiple lists. Guess I need to go through each script list to make sure which one works.
It's a little confusing to have multiple lists. Guess I need to go through each script list to make sure which one works.
I agree it's confusing at first glance - reading the first post, I'm not sure what the difference between the two threads/tables is intended to be (perhaps @Archeia can add something to clarify).

I think this specific example might be an error, as the other methods around it do contain information on what you're supposed to pass as arguments.

For your purposes of trying to use code in the editor, you should probably use the table caethyril linked to (which is also referenced in the first post of the reference thread). It looks like it has more detailed information entered.
Oh, good catch! I'll see about correcting that when I have time, looks like there are some other mistakes in there, e.g. setThrough also accepts true/false. [Edit: done!]

It is a bit confusing. Each one has something the other one doesn't. The Script Call List is focused on practical examples for MV and MZ; the Reference covers all methods applicable to game data, but without examples. The List has links to the Reference sheet where appropriate, e.g. for database record structure and event/move command codes. I rewrote/expanded the List a while ago: it has a lot more content than it used to have.

Original thread: https://forums.rpgmakerweb.com/threads/settransparent-doesnt-work.152964/