[REQUEST] PlayerAction Event

  • I would like to propose the event PlayerAction.


    This event would be triggered if a player presses the "action" (i.e. "F", or KEY_F) key. The handler would receive :

    • the player (lua.wrapper.LuaPlayer), and
    • the chest (lua.wrapper.LuaChest), or the door (???), etc.

    being activated.


    If an object (ex: a chest) is being activated, it would prevent the user from even opening it, thus making it locked.


    This event should also be triggered even if no object is being activated. This would enable scripts to handle the action key when the player is in an area, for example.


    For example



    I am aware of the PlayerObjectStatusChange event, however this even if too limited and would not trigger when the action key is pressed. As a fallback, the PlayerAction could get fired if the action key is pressed, but PlayerObjectStatusChange does not apply. Moreoever, if cancelled, this event would even prevent PlayerObjectStatusChange from being fired.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!