Option to Disable "RunContext" warning

I keep getting this warning in my output, I understand the purpose of it and it’s useful in some cases but not for my case, I know what I’m doing and I should be able to see it once then chose to disable it

Code
local Players = game:GetService("Players")
local localplayer = Players.LocalPlayer

local StarterGui = game:GetService("StarterGui")

local GUI = script.Parent

if not localplayer then
	return
end

if not script:IsDescendantOf(StarterGui) then
	return  
end

local PlayerGui = localplayer:WaitForChild("PlayerGui")
GUI.Parent = PlayerGui
2 Likes

Two possible fixes:

  1. Move the Script with RunContext set to Client in ReplicatedStorage instead so it does not run multiple times

OR

  1. Change the Script with RunContext set to Client to a LocalScript instead so it does not run multiple times
1 Like

I’m not doing any of those, I shouldn’t have to

I set it up the way it is intentionally. My issue is with the warning message, not how many times it runs

You shouldn’t rely on behavior like that, the warning is there because it may cause “unintended behavior”, either currently or in the future. There is no guarantee that the behavior will remain the same going forward.

Additionally for over 99% of developers, that warning is useful for them as they don’t want to rely on unreliable behavior. Adding a setting that almost nobody would use (because better alternatives exist) would use is redundant.

To reliably repeat code, you should look into using either functions or ModuleScripts instead.

I felt like there was a way to disable it, but I guess not. In Studio settings → Diagnosis, you can turn off sound warnings, but surprisingly not much else. I’m sure there are more warnings people would like to not see (example but not Studio-specific I guess), so it could be expanded for sure.
image

Can I ask what Context the warning is in the Output? I assume Studio as it says on the far bottom right. If so, toggling Studio context off would be a temporary yet annoying fix.
image

You’ll have to do this every time you join studio.

1 Like

I don’t think we will do this–you should not be relying on today’s behavior.

Is there some specific reason you are doing it this way instead of this advice?