Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to disable the top bar and enable the chat?

Asked by 5 years ago

Is there any way I can disable the top bar, but having the chat visible? I have tried the code bellow, but it doesn't work and no errors are printed.

local starterGui = game:GetService('StarterGui')

wait()
pcall(function()
    starterGui:SetCore("TopbarEnabled", false)
    starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
end)

2 answers

Log in to vote
2
Answered by
BenSBk 781 Moderation Voter
5 years ago
Edited 5 years ago

If you're not too bothered about the player name and age remaining at the top right, you can instead use PlayerGui:SetTopbarTransparency, which sets the transparency of the topbar to a number between 0 (opaque) and 1 (transparent), and StarterGui:SetCoreGuiEnabled, which allows you to disable specific parts of the core GUI.

We can make the topbar transparent and disable the player list, health, and backpack, leaving only the chat (and the player name and age, which can only be removed using StarterGui:SetCore):

local starter_gui = game:GetService("StarterGui")
local players = game:GetService("Players")
local local_player = players.LocalPlayer
local player_gui = local_player:WaitForChild("PlayerGui")

-- Make the topbar transparent.
player_gui:SetTopbarTransparency(1)
-- Disable all core GUI except chat.
starter_gui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
starter_gui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
starter_gui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
0
Thx! 0_Halloween 166 — 5y
Ad
Log in to vote
1
Answered by 5 years ago

Hi celcinschi,

When you disable the Topbar using that method, then the Chat also gets disabled along with it. That's why you can't enable the chat while disabling the Topbar.

I would recommend just making a custom chat system, not very hard to do and an experience that would prove to be useful in the future.

Best regards,

KingLoneCat

Answer this question