Renaming Services to "CoreGui" via GameScript breaks CoreGui

If services are renamed to “CoreGui” it will break Robloxs CoreGui (CoreScripts) which is pretty annoying.

To replicate this issue, you have to put a LocalScript in ReplicatedFirst with the following code:

for _,v in pairs(game:GetChildren()) do
	v.Name="CoreGui"
	if v.Name=="StarterPlayer" then
		for _,v in pairs(v:GetChildren()) do
			v.Name="CoreGui"
		end
	end
	v:GetPropertyChangedSignal("Name"):Connect(function()
		v.Name="CoreGui"
	end)
end
game.ChildAdded:Connect(function(v)
	v.Name="CoreGui"
	if v.Name=="StarterPlayer" then
		for _,v in pairs(v:GetChildren()) do
			v.Name="CoreGui"
		end
	end
	v:GetPropertyChangedSignal("Name"):Connect(function()
		v.Name="CoreGui"
	end)
end)

Seems it has something to do with a StarterScript .

As-well, that code breaks some roblox analytics in the roblox client:


To fix that, you edit this part in SetttingsHub:
local starterPlayerScripts = StarterPlayer:WaitForChild("StarterPlayerScripts") to

local starterPlayerScripts = StarterPlayer:FindFirstChildOfClass("StarterPlayerScripts")
while not starterPlayerScripts do starterPlayerScripts = StarterPlayer:FindFirstChildOfClass("StarterPlayerScripts") task.wait() end

Placefile:
Example.rbxl (54.8 KB)

Expected behavior

Roblox CoreGui should work even if other services or such are renamed to CoreGui.

6 Likes


it seems that this breaks the internal C++ code that adds the core scripts to the “modules” folder

in the StarterScript it uses


the code that throws the warning is OK

before you ask: i tried to see if i could pass an arbitrary module and have it run with high perms. i couldn’t. it dies way too early for that to work

2 Likes

I found this bug a long time ago but decided to report it now by the way.

1 Like

Thanks for bringing this to our attention. The reported behavior is intentional and we don’t currently have plans to update it.

1 Like

You sure? A GameScript renamed the services, as can be seen in the Report, which makes “Modules”/“RobloxGui” folder be put into the wrong location “Workspace”, which makes RobloxGui/such not work, thus making purchases in studio/sucn not work.

This also breaks internal roblox analytics of games with modified PlayerModules, if services were to be renamed.

So you are confirming that it is intentional that this is a thing? Is this an official method to remove the topbar?

4 Likes

if anyone manages to get the timing right on this, DM me
getting the timing right for this type of stuff outside of studio is a massive pain

1 Like

Hi,

All I was saying was that we currently don’t have a plan to fix this behavior as far as I know.

Generally speaking, it feels like the workaround is “if you know that a certain line of code breaks things, don’t do that”.

At the same time I agree, if this break things, why is the name not read-only?

I think this ticket should be filed as a feature request and you could give a few use cases for how it is useful to rename other services to CoreGui.

This is a bug report, not a feature request, the CoreScript that adds the “modules” folder can be tricked by names. In this topic as far as the replies go, no user mentioned why renaming services to “CoreGui” is helpful.

Certain developers like to give services different names, incase if their too long for their script editor or such,

At runtime (playing, GameScript) i tend to rename services to “CoreGui” so certain exploit scripts fail (ive looked into many exploit scripts and saw some use game.CoreGui so i like to prevent them, it does work cause i have detection logs for my games and i see)
but its quite interesting that Robloxs Own Code (the CoreScripts) in Studio error/Infinite Yield because of not using GetService/such, renaming services does not make it disappear from GetService.

What if other developers, in the content of what they publish to the Creator Marketplace, put stuff that would hide CoreGui? As seen, causing this bug is pretty straight foward.

Ok.

let’s go chat :pray: now we can make our OWN core gui! it’s a feature, not a bug! it’s just the pre-release yk. -Dot said that, not me!

1 Like

Hi,

Thank you for the explanation. It sounds like the root of the problem is then

  • Exploits
  • Variable name length in the Script Editor

It makes sense, though to reopen this I would need to see significant support for fixing this, which would raise the priority of this ticket over other tickets that currently have more support.

I can tell you this though: we’re actively working on generic solutions to prevent exploits, so creators won’t have to resort to hacks like this that can potentially break things in other places.

To shorten names, the common solution is using variables.

I tried this out and it works in roblox studio but not in-game for some reason? Is there a way for it to work in-game?

1 Like

As part of Roblox’s previous update (v686), attempts to retrieve CoreGui via API methods (such as GetService, DataModel indexing, GetChildren, etc.) are locked behind Plugin security, so your Script must be a Plugin, CoreScript, or anything higher in thread identity to access CoreGui or any of its descendants. It’s only locked in Live Sessions (in-game), so you can still retrieve CoreGui in Studio. It makes no sense to me why this change was implemented; however, it consequently resolved the issue in this thread, because GetDescendants and other methods no longer return CoreGui or any of its descendants, so they can’t be renamed.

Release Notes for 686 - Updates / Release Notes - Developer Forum | Roblox

1 Like


1 Like