I'm just wondering if I can modify the script to change the functionality of the flashlight, such as giving it a trigger so it can be used as a weapon or something along those lines
Sure! Creative use of the tutorial is a category. As long as the bones of it are from the tutorial your fine.