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
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.
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.