1. I've been working on a very simple addon (im a beginner) but ive been having problems with it executing. I've been over the code again and again and cant find my error. Any help would be appreciated!

     local isPaladin = select(2, UnitClass("player")) == "PALADIN"
     local RegisterSounds
    
    
        if isPaladin then--You're a paladin
           DEFAULT_CHAT_FRAME:AddMessage("Insert text here", 1.0, 1.0, 0.0)
        else -- You're not a paladin
           DEFAULT_CHAT_FRAME:AddMessage("Insert Text here", 1.0, 1.0, 0.0)
        end
     end
     function RegisterSounds()  -- should make a table and load sounds on that table
        if isPaladin then
           local classSounds = {'Art of War','Aura Mastery','Avengers Shield','Avenging Wrath','Beacon of Light','Blessing','Divine Intervention','Divine Plea',
                    'Divine Shield','Divine Storm','Exorcism','Forbearance','Hammer of Justice','Hammer of the Righteous','Hammer of Wrath Available',
                    'HammerofWrath','Hand of Freedom','Hand of Protection','Hand of Sacrifice','Hand of Salvation','Holy Shield','Holy Wrath','Infusion of Light',
                    'Lay on Hands','Lights Grace','Repentance','Righteous Fury','Sacred Shield','Seal'}
           for  i=1,#(classSounds) do
              LibStub("LibSharedMedia-3.0"):Register("sound", "Pally:"..sounds[i], "Interface\\AddOns\\Pallypack\\"..sounds[i]..".mp3"); -- use LibSharedMedia 3.0 for these sounds
           end
        end
        DEFAULT_CHAT_FRAME:AddMessage("insert text here.", 1.0, 1.0, 0.0); -- print a message after everything is done
     end
    
  2. It depends on what issue you're having. You never call RegisterSounds, so I suspect this code is not doing what you think it's doing. It's almost impossible to tell with such a short code snippet and no further information about what you're trying to do.