Hey, I am making a game where you throw a ball at people that involves you to click your screen using UserInputService. Here is an example below
local UserInputServices = game:GetService("UserInputService")
UserInputServices.InputBegan:Connect(function(input)
if UserInputServices.MouseEnabled then
if input.UserInputType == Enum.UserInputType.MouseButton1 then
---Code here
The thing is it works fine, but when I click on a GUI it keeps going. Every time you click no matter of your in a GUI it will still go. This gets annoying after a while and I cant fix it. I also have another instance when this happens. When you press an E key you get an ability. Example below.
UserInputService.InputBegan:Connect(function(input)
if not UserInputService.TouchEnabled then
if input.KeyCode == Enum.KeyCode.E then
When your typing something in chat, these ability does off if you type in E in the chat. This can get really frustrating if your trying to chat with your friend in-game as some abilities have a lot of vfx.
Is there a value on GUIs or the TextChatService? I don’t know how to fix it and I don’t see it anywhere else.
Thanks (I do check often in the forum so I will respond quick)