So I've been trying to make it where my UserInputService (InputBegan & InputEnded) doesn't execute in chat. Whenever I have a keycode set to lets say X right. And at the input began it will print out "hi", at the input ended it will print out "bye". Simple right. Well if you actually go into the chat and press the letter, it executes the userinput. This is my code
game:GetService("UserInputService").InputBegan:Connect(function(KeyDown) if KeyDown.KeyCode == Enum.KeyCode.LeftShift then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 32 end end) game:GetService("UserInputService").InputEnded:Connect(function(KeyDown) if KeyDown.KeyCode == Enum.KeyCode.LeftShift then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 end end)
I really don't know how to solve this, I've been trying to look online and everywhere but I can't seem to fix the problem. (This code will also be executed in the chat if you press LeftShift, please help me to solve this chat with UserInput problem).
Hey, there is a second function variable that stops this, here is the example:
game:GetService("UserInputService").InputBegan:Connect(function(KeyDown, gameProcessed) if not gameProcessed then if KeyDown.KeyCode == Enum.KeyCode.LeftShift then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 32 end end end) game:GetService("UserInputService").InputEnded:Connect(function(KeyDown, gameProcessed) if not gameProcessed then if KeyDown.KeyCode == Enum.KeyCode.LeftShift then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 end end end)
This basically stops all game events by Roblox from being fired