Help me understand this

Okay lets say we have this line of code right here,
local uis = game:getservice(“UserInputservice”)

uis.inputbegan:connect(function(input,…)
f gpe then return end
you can put anything after input, right? so if i can put anything after the input then why does it do the same thing. the thing after input would be if your typing in the chat then it does return end but if i put something like “pizza” why would it just do that same thing which is prevent the input key from working when your typing in chat

2 Likes

Input began has two parameters:

InputBegan:Connect(function(input, processedEvent)
processed event returns a boolean (true or false), input is your input.

The processed event returns if this input is used by anything else. So like if you use it for a ContextActionService, or if it’s used to trigger shiftlock or trigger the opening/closing of chat.

If that doesn’t make sense here’s what the documentation says on gameProcessedEvent:

Indicates whether the game engine internally observed this input and acted on it. Generally this refers to UI processing, so if a button was touched or clicked from this input, gameProcessedEvent would be true. This is also true for input events connected via ContextActionService.

Since the processed event detects this, if it is true then the input won’t be detected.

If that still doesn’t make sense, here’s the documentation: UserInputService | Documentation - Roblox Creator Hub

1 Like

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