I'm currently working on a game and I wanted to make my own Chat GUI. I have the chats displaying on the screen but I wanted to also make a Chat Bar.
My problem is that I am checking for when the player presses the "/" key, but sometimes the event doesn't fire when the player presses that key.
My code :
-- mouse is the players mouse.
-- gui is the chatgui all the gui objects are being stored in.
mouse.KeyDown:connect(function(key)
if key == "/" then
gui.ChatBox.ChatBox.Text = ""
gui.Label:TweenPosition(UDim2.new(0.05,0,1,0), "Out", "Quad", 1, true)
gui.ChatBox:TweenPosition(UDim2.new(0,0,0.95,0), "Out", "Quad", 1, true)
gui.ChatBox.ChatBox:CaptureFocus()
end
end)
Anyone have any ideas to fix this I've seen other games do this but not sure how they did it.

2 comments
Do have some code that would disable the "/" so that I could use it?
I can do that like do it like in Apocalypse rising, Using Controller Service, but I don't get points for this stuff, check how many answers I answered.