i have a script that if i press a key it makes everything invisible it works but if im typing and i press the key while typing it would work too, how do i stop it when im typing?
this is what im using
game:GetService("UserInputService").InputBegan:connect(function (input) if input.UserInputType==Enum.UserInputType.Keyboard and input.KeyCode==Enum.KeyCode.X then --CODE end end)
InputBegan gives a second argument which you can use to determine if the user is typing or not:
game:GetService("UserInputService").InputBegan:Connect(function(input,isTyping) if input.UserInputType==Enum.UserInputType.Keyboard and input.KeyCode==Enum.KeyCode.X and isTyping == false then --CODE end end)