I'm trying to have it so my local script will only run once, so when you click a play button, the script will be destroyed. Of course when I do this and I reset, the code from that script still runs. Is there anyway that I can make the script only run once?
If you've got your localscript inside of a ScreenGui then that's because of the property "ResetOnSpawn". If you toggle that property off then your script along with the gui won't be reset on spawn.
If you want your gui stuff to reset on spawn but your script not, you can move your localscript to StarterPlayer > StarterPlayerScripts
. Anything that's placed in there will not reset
Destroying the localscript or setting it to disable will not work because the game creates a clone of all then content inside of ScreenGui before the game starts. And replaces the old ScreenGui with the cloned version.