How would I use a / key for a custom made chatbar.... Does this have to do with something like that.. Enum.KeyCodes.Slash.Value
COMMUNITY QUESTION
UserInputService - How do u use / to do something else not use the chatbar?
1 answer
--In a LocalScript
function Pressed(key)--Inside the parameters we put the argument we want to use Outside the word "Pressed" connects the function to the event.
if key == Enum.KeyCode.Slash then--We are checking if key presses the Slash key code this relates to user input service in the connection line.
--Your code here relating to the custom made chat bar.
end;
end;
game:GetService("UserInputService").InputBegan:connect(Pressed)--We connect the service UserInputService and the right event used to use KeyCodes from user input service --If this helped give me a check thank you
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
Lemme test it first
Next,time iiNemo please show us your code so we can be better equipped to understanding and explaining your question.
Hey lego nob.
yo
How do u make it so when u press enter it will work...
Also I did this and it still doesn't work function Pressed(key) if key == Enum.KeyCode.Slash then script.Parent:CaptureFocus() end end game:GetService("UserInputService").InputBegan:connect(Pressed)
It has to be in a localscript