N Suit version 2.0
Introducing packages
With this new version packages have been introduced. Packages are additional tools created by the community for N Suit which are available on the marketplace.
This is a beta feature so you need to enable it in the settings (profile picture > settings > marketplace). You will need to restart the plugin.
Pros:
- Expand the possibilities of development by adding packages to N Suit.
- Add the features you want to your Suit
Cons:
- Packages have to be approved to be published on the marketplace.
- If you update your package it will need to be approved again.
Moderation is enforced to make sure users don’t get affected by malicious scripts. For moderation packages will have to be submitted in the support server. Moderation is done by humans and so it may take time.
Read below to learn how to submit your package.
The marketplace fetches data from GitHub so you need to allow Http requests to https://raw.githubusercontent.com
.
Currently if the package gets updated and you restart the plugin while it has not been approved yet you will need to reinstall it if it’s approved.
If there is an issue with your packages you can restart them in the settings under the beta features section.
For packages developers
Your package will be downloaded from the Roblox library so make sure it is on sale in order to get it fetched into the marketplace and allow users to download it.
Packages are initialized with an init function. package:init()
which has to be placed inside a module script called “Main”.
When you create your package make sure that what you upload to roblox is either directly the module or a folder containing the module as shown in the pictures below.
Directly uploaded module
Module inside a folder
Your package’s scripts will not run after being downloaded so it is important that you make your init()
function run them. The packages manager initializes packages with :init()
so you can use self. No parameters are passed to the init()
function.
To build your package use the N Suit API.
local NSuitAPI = _G.NSuitAPI
A simple example:
local api = _G.NSuitAPI
local mypackage = {}
function mypackage:init()
api:CreateNewTool("name", "rbxassetid://IDOfYourImage") --This creates the button in the main page
local toolFrame = api:CreateNewFrame("name") -- it is important that you put the same name you put in the CreateNewTool function
api:LoadTools() --Refresh the tools page to make your button appear
local button = Instance.new("TextButton")
button.Text = "Oh a cool package"
button.Parent = toolFrame -- put the button in the frame of the package
end
return mypackage
The example above will create a button in the main page which will open a frame dedicated to the package which is basically the workspace of your package.
If you want to test your package before submitting it for moderation you can locally load it into the plugin by clicking on “Load local” in the marketplace page. If you make an edit to the locally uploaded package then just click Load local again and it will replace the old one with the updated one. To locally load a package select it in the explorer and click “Load local”.
Local packages are not persistent and are unloaded when the studio session ends or the plugin is restarted
Your package may be rejected if it:
- Runs malicious code
- Runs while/repeat/for loops that make studio crash
- Uses loadstring()
- Sends data to an external service
Why can’t I use loadstring()
? You can’t use loadstring because it can be used to avoid moderation and run malicious code.
Join the server to submit your package. ( Read below if you don’t have Discord)
Report any bug you find.