Scripts run under players' PlayerGui

On the article about the Script object, it states that a script will terminate when its Disabled property is set to false or the script is no longer a descendant of Workspace or ServerScriptsService.
chrome_MLC40hJ74O

This however is not the case when the script is a descendant of a player’s PlayerGui. It doesn’t matter whether the script initiated there or whether it was moved while running, it will run regardless.

I suggest adding PlayerGui to the list in the second bullet point.
Edit: scripts also run in backpacks as mentioned by @madattak so I suggest adding that to the list as well.

Article: Script | Roblox Creator Documentation

3 Likes

Scripts have always run under PlayerGui and Backpack, the former probably as a legacy from before filtering enabled, definitely just seems to be an oversight in the documentation. Although you probably shouldn’t be running server scripts from the player gui anyway.

6 Likes