VFX Scripter Pro is a useful lightweight plugin that I created to help you easily visualize and script VFX without having to run or play the game in Roblox Studio.
Features
- Real-time scripting
- Restore objects to their original state
- Instant visualization
- Looped mode
- Selective physics
- Play Animations
- Save/Load scripts
Examples
Bomb
Goku
Sword Slash
Animation (using the physics beta feature)
Updates
v1.1.0
v1.2.0
v.1.2.1
v1.3.0
v1.3.4
v1.3.5
Usage
The plugin is fairly simple to use. You can either check out the short YouTube tutorials I made if you’re in a hurry, or read the following for detailed instructions. It is highly recommended to read the latter to prevent issues from happening in your studio. I don’t recommend using this plugin inside your main project place as this plugin messes a lot with Roblox APIs that could break in edge cases. Consider the YouTube tutorials a quick showcase.
Quick Showcase Tutorial
Sword Slash Tutorial
Detailed instructions (recommended)
As said before, this plugin helps you script VFX or mostly anything similar. The way that it works is that you select one or more objects to restore after you are done testing your script.
Selection
After installing and opening the plugin, you should see the widget with a bunch of options. In the MAIN page, under the Selection section, you can select the objects that need to be restored after testing your code. Internally, the plugin will clone the objects and change the parents of the original objects elsewhere to “keep them safe”.
To add one or more objects to restore, select these objects in your workspace or explorer, and then hit “Add Selection”
Note: if you are trying to add nested objects like the screenshot below, the plugin will only take the highest objects in the hierarchy (in this case PartA).
To clear the list of objects to restore, simply hit “Clear Object(s)”
Scripting
Great, we know have the objects that we want to code in our script. We can now go to the SCRIPT page, and choose to “Create Code”. Now, it should look like something like this:
Creating And Writing Code
Obviously, we would want to edit this code, and the only way we can do that is by hitting “Edit”. This will open a new Script where you can edit the code to your desires. You will notice that there is a VspLib
variable (short for VFX Scripter Pro Library). It is strongly recommended to use this when attempting to get any of the objects we put in the list. It’s safer and clearly easier to work with. We can use VspLib.GetInstance(Name)
to get the object with a specific name from our list of selected objects. We can also use VspLib.GetAllInstances()
to get all the objects from our list.
VspLib.GetInstance(Name) Example
Imagine we have these objects that we want to restore:
If we want to get “PartC” for example, we can use the following lines of code:
local VspLib = require(script.VspLib)
local PartC = VspLib.GetInstance("PartC")
The only downside of VspLib.GetInstance
is that it will not detect the actual object’s class. We can partially solve this problem by defining the type like this:
local VspLib = require(script.VspLib)
local PartC: Part = VspLib.GetInstance("PartC")
VspLib.GetAllInstances() Example
Imagine we have this list of Parts that we want to restore:
We can change the BrickColor of all of these Parts by using VspLib.GetAllInstances()
in a for loop like this:
local VspLib = require(script.VspLib)
for _, Part in VspLib.GetAllInstances() do
if Part:IsA("BasePart") then -- Just in case there's a non-Part in the list.
Part.BrickColor = BrickColor.Random()
end
end
Additionally, the VspLib
variable will be treated as a global at runtime. Internally, the plugin will remove that variable, and replace it with the actual VspLib. So changing the variable name will not reference to the actual VspLib
. In simpler terms, do not change that line of code if you want to use VspLib
. It is simply there at the time of editing to provide auto-completion.
Creating Instances (IMPORTANT!)
Though the plugin tries to clean up instances created at run time, it may not catch all instances that are created by the user. For example, if you’re requiring a module that creates an instance, the plugin will be very unlikely to detect it and clean it up. Therefore, it is extremely important to make use of the VspLib.AddInstance
function to make sure that it’s being cleaned up after simulation.
Example 1:
local VspLib = require(script.VspLib)
-- Though the plugin will detect this part automatically...
-- You should still do AddInstance for good practice.
local myPart = Instance.new("Part")
myPart.Parent = workspace
VspLib.AddInstance(myPart)
Example 2:
local VspLib = require(script.VspLib)
-- Though the plugin will detect this part automatically...
-- You should still do AddInstance for good practice.
local myPart = VspLib.AddInstance(Instance.new("Part"))
myPart.Parent = workspace
Example 3:
local VspLib = require(script.VspLib)
local SomeModule = require(path.to.SomeModule)
-- The plugin will ****NOT**** detect this..
-- Not doing AddInstance on `something` will cause it to not be cleaned up
-- And will likely cause memory leaks.
local something = SomeModule:CreateSomething()
VspLib.AddInstance(something)
Creating Code From An Existing Script
There’s also an option to create new code in the plugin by using an existing script. This option will simply copy the code from the selected script in the explorer. It will not write to it.
Clearing Code
To clear code, simply hit “Clear Code”. This action is not reversible, and does not save your code. If you wish to save your code, make use of the Script Library.
Playback
Once we are done writing code for our VFX (or whatever you wrote code for), we can actually run the code in Studio without having to play the game at all.
There are two modes in the playback section: you can either loop it or not. You can simply tick the “Looped” checkbox to change the mode. Using the looped mode, you can change the interval between each run by using the “Interval” slider. This can go from nearly an instant to ten seconds.
Now finally, we can play the code by pressing “Play”. The moment you press that button again, it will stop the playback, destroy the clones, and bring your objects from your list back to their original parent.
Physics
There’s also an option to use physics. You can control the physics speed by simply using the slider below the physics button. You can access the physics speed in the script by using VspLib.GetPhysicsSpeed()
task.wait
, wait
, task.delay
, and delay
are all affected by the physics speed. If you wish to, for some reason, bypass this: multiply the wait duration by VspLib.GetPhysicsSpeed()
.
Scripting in real-time
It is possible to script in real-time. Simply use the looped playback mode and set the desired interval. Then you can script and see the results instantly (if your interval is small enough). Make sure your code is safe enough to be ran in real-time. The wrong typo could cause permanent damage in your Studio. Therefore this should NOT be used in your main project.
Credits
UI Library - @something786
Feedback
This is my first ever serious plugin. Please share feedback for future reference and share anything you have made with this plugin. I am happy to answer questions!
Would you use this plugin?
- Yes!!!
- No, I don’t understand it / it’s too confusing.
- No, it’s missing something.
- No, I don’t need it.
0 voters