Servant is a very small plugin that adds a new method of inserting services into your scripts. Using this plugin, you can set a shortcut that will open a popup to insert a service at the beginning of your script. Typing the service name into the text box and pressing the Enter key (or OK button) will insert a new variable at the top of the script referencing this service.
How to use
After installing, you will need to define a shortcut to open the popup. This can be done by navigating to File > Advanced > Customize Shortcuts. From there, search for “service” and locate the plugin. In my case, I’ve assigned Ctrl + R
as the shortcut to open the window.
After that, pressing your previously assigned shortcut while in a script will display the insert popup. Entering a service name into the text box will show an autocomplete result for the closest match to your input:
Pressing the Tab
key will fill this autocomplete result. Pressing Enter
or the OK button will insert the service at the beginning of the script and close the popup. If you enter an invalid service, it will inform you the service doesn’t exist and you will need to re-enter it.
Required permissions
This plugin sends an HTTP GET request when Studio starts to obtain the latest Roblox API dump. This is used to ensure the service name you’re entering is valid, as well as for autocompletion. The plugin does not require you to give it this permission, but these features will not work if disabled.
It also requires the script injection permission, for fairly obvious reasons (it needs to insert text into the script you’re editing).
Limitations/issues
Currently, there are three issues regarding this tool that (as far as I am aware) are a result of Roblox limitations:
- Popup is not focused when text box is focused, requiring the user to click in the text area to type. This was reported back in May in this bug report.
- Undo support is not available. ChangeHistoryService does not support changes to a script’s source (as listed here), and the workaround offered will not work for this purpose as it would interrupt the script that is currently opened by deleting and re-inserting a new one.
- Scroll position resets to the top when services are inserted. Studio will reset your cursor position to the beginning whenever a script’s source is modifed externally. There was a feature request made to address this all the way back in 2017.
If anyone has suggestions on how to get around these issues, feel free to mention them!
Hope you find this plugin useful!