Ok, so at first all I did was disable the top bar, but have module.ChatOnWithTopBarOff = true
set in the ChatSettings, and so the chat worked fine. The Top bar was disabled and the chat still worked. However, now I have an intro that plays when the player joins, and so I disable the chat (so it’s not in the way)
Then I re-enable the chat once the intro has finished.
This has however caused the chat to just never show up now.
I know the top bar disables all CoreUI, but this chat setting meant it worked before. So how can I work around this? Seen other games (that use Roblox default chat) have the topbar removed and no chat during their intros, but then re-enable the chat later on, while keeping the topbar disabled.
Is there any easy way to disable the chat scripts from running until I want them to run?
Don’t want that, as there is no way to remove the PlayerName and +13 on the top right hand side of the screen (above the PlayerList) even when every CoreUI is disabled.
So I have to disable the TopBar so that doesn’t show up.
Your alternative solution would be a replacement of a custom chat over it. There’s no way we can bring back the UI element without setting the TopbarEnabled true.
There’s no chat, TopBar is completely gone, etc. But when the game loads, the top bar is still not there, but the chat is. They use the default roblox chat too
Sadly, I’m not experienced with using the modules. Perhaps the next person who’ll reply have a better clue of implenting this or even a better clue of how it actually works.
You could fork the ChatServiceRunner and make it lazy load the chat service or stall running any components until you flag it to do so. ChatServiceRunner eagerly loads all the chat system core modules.
I’m not sure what’s wrong with your original implementation though? This is fine and how it should be done. I made a repro in less than a minute that keeps the topbar removed and can flip between the chat being enabled and disabled. You don’t need to stop scripts from running just to accomplish this. That would cause unintended issues anyway.
local StarterGui = game:GetService("StarterGui")
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function (InputObject, GameProcessedEvent)
if not GameProcessedEvent then
if InputObject.KeyCode == Enum.KeyCode.C then
local Flip = not StarterGui:GetCoreGuiEnabled("Chat")
StarterGui:SetCoreGuiEnabled("Chat", Flip)
end
end
end)
StarterGui:SetCore("TopbarEnabled", false)
-- In repro as well: ChatSettings with ChatOnWithTopbarOff = true
I saved the file and ran a local server without changing a single thing. It worked as intended. Press the slash key after each time you press C and you’ll see that you’re able to chat or that the window disappears.