[PLUGIN] Comment Scripter

Comment Scripter


Plugin Link

I’d like to introduce my new plugin, Comment Scripter, to all programmers out there! Comment Scripter is designed to simplify the process of loading and saving lines of code in Roblox Studio and save you time.

To use Comment Scripter, simply add comments to your script starting with --//load, --//save, or --//delete, followed by the name of your script file surrounded by arrows and an exclamation mark. For example:

--//save <MyScript> !
print('Hello, world'!)
--//save END !

After you have typed out both exclamation marks, your script will be saved to a local file named “MyScript”. Later on, you can load the script again by typing --//load <MyScript> ! into a new script.

Comment Scripter helps make scripting faster. You can easily save, load, and delete scripts with just a few keywords. If a file doesn’t exist, Comment Scripter will throw a warning in the output and prevent any errors from occurring.

To start using Comment Scripter, you can install the plugin by clicking the link at the top of this topic and create a new script. Then, use the commands mentioned above to manage your scripts.

Here are a few examples of the commands said above:

--//save <test> !
cs-saving

--//load <test> !
cs-loading

--//delete <test> !!
cs-deleting

--list !
cs-listing

If you have any questions or feedback, feel free to reply to this topic. I’m looking forward to hearing any feedback you may have!

PS: I just updated the plugin with a new command, so if you already had the plugin before I updated it and you want to use the --//list ! command, then you will have to do what I have said here.

9 Likes

Looks neat. Have a question though. What’ll happen if I save 2 scripts with the same name? (Haven’t installed the plugin yet.)

1 Like

Thanks, it just overwrites the other one with the new one you saved.

Hey. Just a suggestion, but can you add a list command where it shows how many pieces of code you’ve saved? I already lost one and don’t want to create another .-.

1 Like

Thanks for the suggestion! I just finished adding it to the plugin and updating it. The only thing is that you need to go to your files and add a list setting into your settings.json file.

Your settings.json file path should look something like this:

C:\Users\****\AppData\Local\Roblox\{YOUR_USER_ID}\InstalledPlugins\{PLUGIN_ID}\settings.json

The plugin ID is 13110608582.

Inside the settings file, it probably looks something like this.

{ "ViewSelector_PositionY":0.010544806975006716307, "ViewSelector_Active":false, "Toolbox_SelectedCategoryName":"FreeMeshes", "PlayerEmulator_CountryRegionSetting":"PH", "ACE_SnapMode":"Keyframes", "Toolbox_SelectedSearchTerm":"bonesaw", "Toolbox_SelectedSortIndex":1, "ViewSelector_PositionX":0.9818818063446970168, "ACE_ShowAsSeconds":true, "userRequestedRenameDialogNeverShow":true, "ACE_RotationType":"EulerAngles", "ACE_EulerAnglesOrder":"XYZ", "CoreDraggersSummonHintHidden":true, "PlayerEmulator_PluginWidgetState":false, "breakpointsWindowConfigs":{ "ColumnFilter":[ ], "ColumnSize":[ 0.28571429848670959473,0.57142859697341918945,0.14285714924335479736 ] }, "callstackWindowConfigs":{ "ColumnFilter":[ "FrameColumn","SourceColumn","FunctionColumn","LineColumn" ], "ColumnSize":[ 0.125,0.125,0.375,0.25,0.125 ] }, "watchWindowConfigs":{ "Tab":"Watches", "ScopeFilter":[ "Local","Upvalue","Global" ], "WatchVariables":[ "part:GetAttribute('Player')" ], "ColumnSizeVariables":[ 0.25,0.25,0.25,0.25 ], "ColumnSizeMyWatches":[ 0.3333333432674407959,0.3333333432674407959,0.3333333432674407959 ] }, "PlayerEmulator_IsEnabled":false, "hello world":"print('Hello, World!')", "basic datastore script":"local DS = game:GetService('DataStoreService')\nlocal HS = game:GetService('HttpService')\n\nlocal DataStore = DS:GetDataStore('PlayerStats')\n\nlocal Leaderstats:{{ Name:string, Type:string, InitialValue:any }} = {\n\t{ Name = 'Money', Type = 'IntValue', InitialValue = 125 };\n\t{ Name = 'Level', Type = 'IntValue', InitialValue = 0 };\n}\n\nfunction playerAdded(player:Player)\n\tlocal data:string?\n\t\n\tlocal success, err = pcall(function()\n\t\tdata = DataStore:GetAsync(player.UserId)\n\tend)\n\t\n\tlocal folder = Instance.new('Folder')\n\tfolder.Name = 'leaderstats'\n\tfolder.Parent = player\n\t\n\tfor i, v in Leaderstats do\n\t\tlocal objectValue:ValueBase = Instance.new(v.Type)\n\t\tobjectValue.Value = v.InitialValue\n\t\tobjectValue.Name = v.Name\n\t\tobjectValue.Parent = folder\n\tend\n\t\n\tif success then\n\t\tlocal decodedData:{ [string]: any } = HS:JSONDecode(data)\n\t\t\n\t\tfor name, value in decodedData do\n\t\t\tif folder:FindFirstChild(name) then\n\t\t\t\tfolder[name].Value = value\n\t\t\tend\n\t\tend\n\telse\n\t\tplayer:Kick('Failed to load data for key {player.UserId}, please rejoin.')\n\tend\nend\n\nfunction playerRemoving(player:Player)\n\tlocal folder = player:FindFirstChild('leaderstats')\n\t\n\tlocal dataToSave = { }\n\t\n\tfor i, v:ValueBase in folder:GetChildren() do\n\t\tdataToSave[v.Name] = v.Value\n\tend\n\t\n\tlocal encodedData = HS:JSONEncode(dataToSave)\n\t\n\tlocal success, err = pcall(function()\n\t\tDataStore:SetAsync(player.UserId, encodedData)\n\tend)\n\t\n\tif success then\n\t\tprint('Successfully saved data for player {player.Name}!')\n\telse\n\t\twarn('Could not successfully save data for player {player.Name}! Error: {err}')\n\tend\nend\n\ngame.Players.PlayerAdded:Connect(playerAdded)\ngame.Players.PlayerRemoving:Connect(playerRemoving)", "SaveData":"{\"enabled\":false,\"sources\":{\"LocalScript\":\"\",\"Script\":\"aaa\",\"ModuleScript\":\"local module = { }<br><br>function module.test(parameters)<br>\\t<br>end<br><br>return module\"}}", "scripting tools plugin":"assert(plugin, 'This script is for a plugin, not for a game!')\n\nlocal toolbar\n\nif game.CoreGui:FindFirstChild('ScriptingToolsTB') and game.CoreGui.ScriptingToolsTB.Value then\n\ttoolbar = game.CoreGui.ScriptingToolsTB.Value\nelse\n\tif game.CoreGui:FindFirstChild('ScriptingToolsTB') then game.CoreGui.ScriptingToolsTB:Destroy() end\n\t\n\ttoolbar = plugin:CreateToolbar('Scripting Tools')\n\t\n\tlocal value = Instance.new('ObjectValue')\n\tvalue.Value = toolbar\n\tvalue.Name = 'ScriptingToolsTB'\n\tvalue.Parent = game.CoreGui\n\t\n\tlocal owner = Instance.new('ObjectValue')\n\towner.Value = plugin\n\towner.Name = 'owner'\n\towner.Parent = value\nend\n\nplugin.Unloading:Once(function()\n\tlocal value = game.CoreGui.ScriptingToolsTB\n\tlocal owner = value:FindFirstChild('owner').Value\n\t\n\tif owner.Value == plugin then\n\t\tvalue:Destroy()\n\tend\nend)\n\nlocal pButton = toolbar:CreateButton('Comment Scripter', '', 'rbxassetid://11570895459')\npButton.ClickableWhenViewportHidden = true\n\n-------------------------------------------------------- Main Code --------------------------------------------------------\n\n"}

In the middle, you will start seeing your saved lines of code with their names, like this:
"hello world":"print('Hello, World!')"
Try to find the first save you did (In my case, that’s the one above). Then, try to get all of the names of your saves and put it in a JSON table. Like this:
...or_IsEnabled":false, "list":"[ \"hello world\", \"basic datastore script\", \"scripting tools plugin\" ]", "hello wor...
Make sure to surround the JSON table with double quotes and put back slashes before each double quote inside each item in the table.

After that, you’re pretty much done! The plugin should handle the rest.

1 Like

Gotcha, thanks for the info! This reminds me of the shortcut plugins, instead in a *comment-ing` way.

1 Like

The comments look a little lengthy, maybe use the Autocomplete APIs to make it less work to type?

1 Like

This is so cool! I always wanted Roblox to add this instead of Generative AI, it’s literally 100^1000 times better, good job!
If it’s possible you could add an autofill feature, you write and something like Intellisense comes out and you can see the preset scripts, choose one (also see it’s content) and then use Tab to autofill it

(And I really think you should make this paid)

2 Likes

Can’t you just use copy and paste…?

3 Likes

Yes but this way you can save them for future use, imagine if Roblox allowed you to do this…
This literally replaces Generative AI
(Say I’m wrong?)

The code segements are still saved in scripts. Maybe the usage of module scripts, like everybody should be using, would eliminate the need to even copy and paste boilerplate code.

This is not AI?

1 Like

This would be useful for things like long connections, instead of writing

game:GetService(“Players”).PlayerAdded:Connect(onPlayerAdded”)

You can write

--//load <PlayerAdded>

Done

I know, Even better

So I feel like this should instead be built as a code snippet editor? It would be more user friendly anyways. Maybe another good plugin idea?

It would be, and it would completely replace Generative AI! Great!

uummm good idea, but I’m wondering if the Original Poster (@O3_O2) will do that

1 Like