• DanielsRevenge
    21st July Member 0 Permalink

    How would one go about making lua tools? I personally want to create a tool that, whenever you click on an element, tells you its ID.

  • LBPHacker
    21st July Developer 0 Permalink
    There's currently no API for tools, so you have to resort to hacks. How straightforward these hacks are depends on how complex a tool you have in mind. Yours is not too complex, the abstract would be: register an element, put it in the tools section, then register a mousedown event handler that checks if tpt.selectedl (or selecteda or selectedr, depending on the button parameter of the event) is the element's identifier, and if it is, print(sim.partID(sim.adjustCoords(tpt.mousex, tpt.mousey))), then return true to prevent the element from being drawn.