Is there a way to work around this tedious if else approach?

So I want to add VFX to my attacks and each attack animation will have a unique VFX that happens. Is there a way to connect the VFX to the animation(Without including the VFX within the animation export)?

I want to avoid this kind of thing(Most people do VFX this way.)

if attack1 then
   -- attack 1 vfx
   -- play attack1 animation
elseif attack2 then
   -- attack 2 vfx
   -- play attack2 animation
end

This is extremely tedious and if I want to add more animations it will not be really great to work with.

I want to be able to drag and drop animations, say, in an animations folder and able to connect the unique VFX to each of those animations.
image

And with this, able to test play the animations like this(also making the unique VFX appear):

local anims = Moveset:GetChildren()
while true do
    local anim = anims[math.random(#anims)]
    local animTrack = humanoid.Animator:LoadAnimation(anim)
    -- some code to play the connected vfx
    animTrack:Play()
    animTrack.Stopped:Wait()
end

You can have a dictionary which maps names to functions, or something:

local effects = {
  ["attack1"] = function()
    -- play attack1 effects
    print("doing attack1")
  end,
  ["attack2"] = function()
    -- play attack2 effects
    print("doing attack2")
  end,
}

local anims = Moveset:GetChildren()
while true do
    local anim = anims[math.random(#anims)]
    local animTrack = humanoid.Animator:LoadAnimation(anim)

    local effectFunc = effects[anim.Name]
    effectFunc()

    animTrack:Play()
    animTrack.Stopped:Wait()
end