Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

UserInputService - How do u use / to do something else not use the chatbar?

How would I use a / key for a custom made chatbar.... Does this have to do with something like that.. Enum.KeyCodes.Slash.Value

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

7 comments

0

Lemme test it first

0

Next,time iiNemo please show us your code so we can be better equipped to understanding and explaining your question.

0

Hey lego nob.

0

yo

0

How do u make it so when u press enter it will work...

0

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)

0

It has to be in a localscript

This discussion is preserved as it was. New answers, comments, and votes are closed.