GameProcessedEvent constantly returning false

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to process inputs, but for some reason, the game does not process inputs as expected.

  2. What is the issue? GameProcessedEvent is supposed to fire when the input is valid, and return false when the game is not recognizing the input, for example when they are typing in chat or in the Roblox menu. However, it is doing the inverse, and only returning true if the game event should NOT have been processed.

This is my code, used to recognize when the player is making an action such as peeking or hiding whilst in a seat

if seat:FindFirstChild("Adjust") then
local adjustevent = seat.Adjust
local UIS = game:GetService('UserInputService')
	
	UIS.InputBegan:Connect(function(key,processed)
		print(processed)
		if key == Enum.KeyCode.LeftShift then
			if seat:GetAttribute("canPeek") == true then
				adjustevent:FireServer("peek")
				local peek = Instance.new("Animation")
					peek.AnimationId = seat:GetAttribute("peekanim")
					char.Humanoid.Animator:LoadAnimation(peek)
					peek:Play()
					peek.Stopped:Wait()
					print("Played")
			end
end)
1 Like

There is no error here, it returns true when player is typing on chat… and returns false when the player is not typing. There is no error, mark as solution if helped

Have a good day :slight_smile:

3 Likes

processed should be true if the game itself (id est the Roblox engine) processed the event. That’s it, you just check if it’s true or not. If it’s true, some other Roblox script or the engine itself (like the camera script or typing into a TextBox) are using the input.

1 Like

I’m sorry! I clearly misinterpreted what this function was for as a boolean. Thank you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.