Hello!
I am looking to edit the existing chat GUI. I do not want to create a custom one, I simply want to remove parts, and move them. Here is my code:
local player = game.Players.LocalPlayer
local function OnChatLoad()
local chat = player.PlayerGui.Chat:WaitForChild()
local ChatPos = chat.Frame.Position
chat.Frame.Position = UDim2.new(ChatPos.X.Scale, ChatPos.X.Offset, 0.715, ChatPos.Y.Offset)
chat.Frame.ChannelsBarParentFrame:Destroy()
chat.Frame.ChatChannelParentFrame:Destroy()
end
OnChatLoad()
The issue is that the script errors. The error given is:
23:51:40.737 Chat is not a valid member of PlayerGui "Players.Jay3721.PlayerGui" - Client - Move Chat:4
I have tried adding a one second wait via wait(). That is pretty “clunky” and not well optimized, so I’d love to be able to take advantage of an event or something of that nature to run the function to edit the chat so that I know the “Chat” UI is loaded before running it.
Thanks!