Before answering, I would like to remind all askers and readers that for practical matters, all questions should be directed to a competent Rabbi. That being said, let me quote the חיי אדם סי׳
קנג:
ואף על גב שמצוה גדולה לשמוח אבל אסור להבעיר פולווער וראוי למחות ולגעור
בעושין כן אבל מותר לקבוע שפופרת מלאה פולווער בתוך הנר בערב יום טוב
אע"פ שהנר כבה על ידו (מגן אברהם סימן תקי"ד):
Despite the fact that it is an extremely important mitzvah to be joyous [on Simcha Torah], it is prohibited to light "powder" [gunpowder], and one should prevent and protest those who do. It is, however, permitted to place a vial of gunpowder in a candle on erev Yom Tov, despite the fact that it will cause the candle to go out [when the gunpowder explodes].
It seems based on this that lighting a firecracker would be prohibited, but that you can set one up before Yom Tov to go off.
Again, practical questions should be asked to a Rav.