Hi, I recently hired a scripter to make me a Gui that opens when I press "B". Now everything works fine but there's just one thing, When I type B for example: "Big" in chat it opens the Gui. I asked him if he could fix the issue but he hasn't replied in 4 weeks. Could anyone please help me out with this?
local inputservice = game:GetService("UserInputService") inputservice.InputBegan:connect(function(i,g) if i.UserInputType == Enum.UserInputType.Keyboard then if i.KeyCode == Enum.KeyCode.B then game.ReplicatedStorage.OpenBook:FireServer() end end end)
If you don't want it to fire the RemoteEvent when you press B while typing in chat, then you could add this:
local InputService = game:GetService("UserInputService") InputService.InputBegan:Connect(function(Input, IsTyping) if IsTyping then return end if Input.UserInputType == Enum.UserInputType.Keyboard then if Input.KeyCode == Enum.KeyCode.B then game.ReplicatedStorage.OpenBook:FireServer() end end end)