Way to check if player is in menu

Hi, title says it all really, is there a way to check if the player is in, for example the ulx menu, or a suggestions menu etc

Or a way to check if a player is in a text box, is just as useful

Whether you can do this or not depends on the menu.

You might need to edit the menu files to do what you want.

But the way you’d do it, and it is only possible on client ( on server you gotta network it from client to server and then to all other clients ) is to see whether a, for examples a global variable that the panel is assigned to exists, is a valid panel ( IsValid() check ) and is visible - IsVisible() check.

UPDATED: Getting an error about trying to index global SMenu which is the panel im trying to check for

[editline]2nd September 2015[/editline]

Unless, there is a way to check if the player is typing

How can we fix this without the code? Magically?
The code, please

Attempted to index global ‘Smenu’ (a nil value)

if p:IsTyping() or Isvalid(Smenu.MessagePanel) or IsVisible(Smenu.MessagePanel) then --THIS LINE
					v.Pressed = true;

Yes thank you for that amount of code and that full error which clearly showed us what SMenu is and why that code doesn’t think it exists /s.

In all seriousness though Smenu is probably local and your trying to call it from outside the function it’s created in or another file.


Good idea :slight_smile: testing now, thanks