Problem with user input service

I am using input service for ‘tab’ and it won’t work why?

here’s my code:

userInputService.InputBegan:Connect(function(input, gameProccessedEvent)
	if input.KeyCode == Enum.KeyCode.Tab and not gameProccessedEvent and beingInspected then
		print("Tab")
	end
end)

Is it because the roblox context action service binded in the core GUI for leaderboard etc?

What is the beingInspected variable set to??
And can you just do
print(input.KeyCode) before the if statement?

It seems its the gameProccessedEvent is what messes it up and its probably because the core Gui context binded tab button.

P.S. I tried changing it to and gameProccessedEvent and and not gameProccessedEvent still doesn’t work both times.

Also it seems and added and statements seem to throw it off I tried having just the and beingInspected and it doesnt work with that and I know the beingInspected value works because I have it printing its value every 1 seconds.

Um, that’s not what that means. It means that it’s another variables problem… Because gameProcessedEvent (if they’re chatting) is just a simple bool variable. Now, what is the beingInspected variable set to. Because that is the most likely issue, and as I said. For debug, please put the print in, so it shows.

I understand that but the gameProccessedEvent is whats messing it up. This doesnt work

if input.KeyCode == Enum.KeyCode.Tab and beingInspected and not gameProccessedEvent then
	print("Tab")
end

this does work

if input.KeyCode == Enum.KeyCode.Tab and beingInspected then
	print("Tab")
end

the isBeingInspected is a value I set to true in another function when the e key is pressed and it works but it stops working when I add the gameProccessedEvent and I dont know why since I use it for other ```userInput```` statements

Okay, my bad, it’s the gameProcessedEvent, you’re right. I’m going to assume it’s your answer that it’s a specific gameEvent meaning that it wants the UIS to ignore the action. I tested it with this code:

game:GetService("UserInputService").InputBegan:Connect(function(input, gameProccessedEvent)
	print(input.KeyCode)
	if input.KeyCode == Enum.KeyCode.Tab and not gameProccessedEvent then
		print("Tab")
	end
end)

image

Heres my full code

userInputService.InputBegan:Connect(function(input, gameProccessedEvent)
	if input.KeyCode == Enum.KeyCode.E and not gameProccessedEvent and not beingInspected then
		check_inspect()
	end
	
	if input.KeyCode == Enum.KeyCode.Tab and beingInspected then
		print("Tab")
	end
	
	if input.KeyCode == Enum.KeyCode.Space and beingInspected then
		print("space")
	end
end)

see the first if input statement works. Then the check_inspect() will set the beingInspected to true

but I don’t think context action service should mess with gameProccessedEvent but I’m not sure.

Adding on, removing the gameProccessedEvent if statement part makes it so it prints tab, So I made a stupid mistake. : |

gameProcessedEvent refers to when a user interface was interacted - and with tab, this occurs (returns true) as you’re binding with the player leaderboard.

see heres what weird if I press tab and I have the print(input.KeyCode) in there it will print Enum.KeyCode.Tab but it wont run print("Tab")

see this is what I thought but I dont know how to unbind it I will eventually just set the coregui to false but I wanna unbind this how can I do this I found the script that binds the leaderboard what do I do with it?

Technically I fixed it I just set the starterGui:SetCoreGui all to false

That’s right, I thought you could unbind it with ContextActionService, but due to security reasons, that’s not allowed. Setting the list’s core to false would do it.