Detect when an user press enter in the command bar

Im making a roblox free plugin and I don’t have any idea on how to detect when an user press “enter” in the command bar. And is there a way to remove errors from the output ?

I think that could be detected using user input service, idk any way to block errors. Try pcalls?

i’ll see if this work but i didn’t know you could use UserInputService for plugins.

I don’t think it’s that easy because i need to see where the command bar’s script is

This may help How to use UserInputService in Plugins?

We cannot use UserInputService in DocumentScript…

what is even horrible is that roblox block us from modifying the content of the command bar. This is a big problem because I need to make a check when he type the text and so one…

But at least i managed to do this
image

I should recheck the code because it is not that optimized (6 indentation level is enormus for me)

If anybody got an idea on how I can update this please post it !