How to stop a script after the script has fully been ran

i’m having issues trying to STOP a script right after the script has been fully ran so that when you reset, it won’t have to do the loading thing again, is there any way i could fix this?

https://streamable.com/zscjsv <-- video of the issue.

i’ve tried to disable the script, but according to some people in this developer forum, it’s wiki about disabling the script aka: script.Disabled = true is not actually what it seems, i’ve tried putting it to the front, which didn’t work, then i tried to put an if statement to check if it’s finished loading by creating a value and then checking it from there, but both of them didn’t work whatsoever.

and here’s an example of the if statement if you’re wondering.

value = 0

if value == 0 then
 <script goes here>
elseif value == 1 then -- and i ALREADY know there's something with 'else' i could do, but i like this way.
 -- i put nothing here.
end

Can’t you just set ScreenGui.ResetOnSpawn to false?
Also I feel like this topic belongs to #help-and-feedback:scripting-support category.

5 Likes

i’ll try that…

i thought that would fit to UI stuff, but sure i guess i’ll move it?

ah, it worked, but i decided to disable it on the screengui properties instead.

thanks!

1 Like