I wanted players to automatically learn their class spells upon leveling up, I really thought this would work, but for some reason it does not =(
Code:
function Teach_OnPostLevelUp(Event, pPlayer)
if pPlayer:GetPlayerLevel() == "4" then
if pPlayer:GetPlayerClass() == "Warrior" then
pPlayer:LearnSpell(100) -- Charge
pPlayer:LearnSpell(772) -- Rend 1
end
elseif pPlayer:GetPlayerClass() == "Mage" then
pPlayer:LearnSpell(116) -- Frostbolt 1
end
end
RegisterServerHook(27, "Teach_OnPostLevelUp")
I'm not getting any errors when I run this, simply nothing happens when I test it. What's wrong here? As always, I'll +Rep anyone who can post a helpful comment.