Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago
--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
0
Lemme test it first User#7446 0 — 9y
0
Next,time iiNemo please show us your code so we can be better equipped to understanding and explaining your question. legomaster38 39 — 9y
0
Hey lego nob. MessorAdmin 598 — 9y
0
yo legomaster38 39 — 9y
View all comments (3 more)
0
How do u make it so when u press enter it will work... User#7446 0 — 9y
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) User#7446 0 — 9y
0
It has to be in a localscript legomaster38 39 — 9y
Ad

Answer this question