Another thing to note is that SetCorecan fail, so you should always wrap in in a pcall and retry if it does.
local StarterGui = game:GetService("StarterGui")
if script.Parent.load.Frame.Visible == true then
local success, message = pcall(StarterGui.SetCore, StarterGui, "TopbarEnabled", false)
while not success do
game:GetService("RunService").Stepped:Wait()
success, message = pcall(StarterGui.SetCore, StarterGui, "TopbarEnabled", false)
end
end
It’s case sensitive, the error means it hasn’t been registered by core scripts, which is because TopBarEnabled doesn’t exist.
pcall is short for protected call, which means functions executed inside it won’t stop script execution if they error. If they do error, you also get the error message back which can be helpful when dealing with stuff like Datastores. Here’s the wiki page, and an article about it.