So, I am making a custom chatbar, I am making my own custom chat, but I want the scripts to be SEPERATE. I know I need to use the player:chatter even but nothing I do seems to work. I've expiremented with using keys fro scripts, but they don't seem to work either, like this for example, this is a toggle script for a gui:
local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function(key) if key:byte() == "115" then script.Parent.Visible = not script.Parent.Visible end end)
What am I doing wrong, and how can I use this to make a chatbar?
Here's an example script I guess of a chatbar, it's from a custom ChatGui I am looking at, is there anyway something similar to this could work?
function Chat:CreateChatBar() self.ClickToChatButton = self.Gui:WaitForChild("ClickToChat") self.ChatBar = self.Gui:WaitForChild("ChatBar") self.ClickToChatButton.Visible = true self.ChatBar.Visible = true local mouse = game.Players.LocalPlayer:GetMouse() mouse.KeyDown:connect(function (key) if key == '/' then self.ClickToChatButton.Visible = false self.ChatBar:CaptureFocus() end end) self.ClickToChatButton.MouseButton1Click:connect(function () self.ClickToChatButton.Visible = false self.ChatBar:CaptureFocus() end) end
I know this sript wouldn't work at all, and I do not want a "ClickToChat" overlay ontop on the Chatbar. I just want you to be able to press enter or something afterwards so that it automatically updates.
Thanks!