I fixed it because I did not see a flag events code on top of the forever code.
Credit to FluffyTrembler123 for the original.