MZ Unable to make a custom button work for a plugin

Hey, so I am working on a personal plugin that makes D20 dice rolls possible in RPG Maker MZ, currently under construction and largely unfinished, and I am coming across this issue.

So I want to build my own button for rolling the dice and picking a random number, and while it did work on the built-in sprites, I can't seem to get it work in the code. Whenever I click it, nothing happens and the event does not execute at all. What am I doing wrong and how can I fix this issue?

The code is right here:

createRollButton() {
const W = 180;
const H = 60;
const Y_OFFSET = 120;
const bmp = new Bitmap(W, H);
bmp.fillRect(0, 0, W, H, "rgba(50,50,50,1.0)");
bmp.strokeRect(0, 0, W, H, "rgba(255,255,255,1.0)");
bmp.fontSize = 30;
bmp.textColor = "#ffffff";
bmp.outlineColor = "rgba(0,0,0,0.8)";
bmp.outlineWidth = 4;
bmp.drawText("Roll", 0, 0, W, H, "center");
const btn = new Sprite(bmp);
btn.x = (Graphics.width >> 1) - (W / 2);
btn.y = (Graphics.height >> 1) + Y_OFFSET;
btn.interactive = true;
btn.buttonMode = true;
btn.hitArea = new PIXI.Rectangle(0, 0, W, H);
btn.on("pointertap", () => this.onRoll());
btn.on("pointerover", () => (btn.alpha = 0.8));
btn.on("pointerout", () => (btn.alpha = 1));
this.addChild(btn);
this.rollbutton = btn;
}

I appreciate any help for this!
I think you should post this here.
Hey GR147,

I don't know about your programming experiences, so don't take it personally when I'm explaining something that is way below your level.

First of all, in your code snippet, you are defining a method. But are you actually calling it anywhere in your game?

Code:
this.addChild(btn);
this.rollbutton = btn;
The "this" might not be correct here. You always need to know where "this" is referring to. In this context, I would say, you want to refer to the current scene. You can do that by writing this:

Code:
SceneManager._scene.addChild(btn);
SceneManager._scene.rollbutton = btn;

Original thread: https://forums.rpgmakerweb.com/threads/unable-to-make-a-custom-button-work-for-a-plugin.180776/