Hello!
I was making a chat system and I wanted it to be opened when you use press “/”. So I tried this:
--[[
UserInputS = game:GetService("UserInputService")
Typer = Typer TextBox
MainF = Frame wich contains all the chat
]]
UserInputS.InputBegan:Connect(function(input, impedido)
if input.KeyCode == Enum.KeyCode.Slash and not impedido then
Typer:CaptureFocus()
Typer.Text = ""
MainF:TweenPosition(UDim2.new(0,10,0,50), nil, nil, 0.5, true)
end
end)
I tried it and I realized it don’t works. Then I toke a look and I realized that the Enum.KeyCode.Slash
, had a weird description:
So I decided open a emty place wich prints my inputs and I recibed that when I pressed slash, It printed
Enum.KeyCode.LeftShift
and Enum.KeyCode.Seven
, wich is the combination of keys you need to pres on the spanish keyboard (the one I use) to write “/”.So the
UserInputService
records the keys you press, no the ones you are typingSo do anyone know how to run a function when you press the Slash (“/”) key on the keyboard?