# API

<table><thead><tr><th width="203">Function</th><th>Description</th></tr></thead><tbody><tr><td><code>.onSelect(func)</code></td><td>Calls <code>func</code> everyime selection changes</td></tr><tr><td><code>.pathOf(instance)</code></td><td>Gets path of instance <code>game.ReplicatedStorage["my vfx"]</code></td></tr><tr><td><code>.log(string, t)</code></td><td>Uses <code>shared.fx.ui.notify()</code> to make a notification of types:<br>                         <code>1</code> = success <code>2</code> = warn <code>3</code> = error</td></tr><tr><td><code>.sound(sound, clone?)</code></td><td>Returns a clone of <code>sound</code> that works in EditMode (plugin env)</td></tr></tbody></table>

{% code title="Command bar tests" %}

```luau
print(shared.fx.pathOf(workspace["my vfx"]))
--
shared.fx.log("successful!!", 1)
--
local mySound = workspace.myVFX.sound
local workingSound = shared.fx.sound(mySound)
mySound:Play() -- workingSound will mimic mySound
task.wait(mySound.TimeLength)
workingSound:Destroy()
```

{% endcode %}

<table><thead><tr><th width="131">Property</th><th>Description</th></tr></thead><tbody><tr><td><code>.ui</code></td><td>The UI-Library</td></tr><tr><td><code>.selected</code></td><td>Equal to <code>game:GetService("Selection"):Get()</code></td></tr><tr><td><code>.selectedVFX</code></td><td>All selected VFX including descendants (excluding containers)</td></tr></tbody></table>
