Auto Trainer Not Working menu

These ads disappear when you log in.

Results 1 to 3 of 3
  1. #1
    choweyiii's Avatar Contributor
    Reputation
    91
    Join Date
    Aug 2010
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)

    Auto Trainer Not Working

    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.

  2. #2
    Thaadevil's Avatar Contributor
    Reputation
    318
    Join Date
    Apr 2011
    Posts
    936
    Thanks G/R
    1/8
    Trade Feedback
    4 (100%)
    There's a macro to just train everything, how lazy can people be?

  3. #3
    choweyiii's Avatar Contributor
    Reputation
    91
    Join Date
    Aug 2010
    Posts
    127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    I actually figured this out. I fixed it by removing the quotations around the level and added a localization, the correct form is as follows: (if anyone is wondering)


    Code:
    function Teach_OnPostLevelUp(Event, pPlayer)
    local Class = pPlayer:GetPlayerClass()
    	if pPlayer:GetPlayerLevel() == 4 then 
    	if (Class == "Warrior") then
    	pPlayer:LearnSpell(100) -- Charge
    	pPlayer:LearnSpell(772) -- Rend 1
    	end
    
    RegisterServerHook(27, "Teach_OnPostLevelUp")

Similar Threads

  1. Whydb trainers not working?
    By brock106 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 12-12-2008, 07:03 AM
  2. DBC editing not working anymore?
    By Charade in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 12-13-2006, 01:37 PM
  3. Wow glider is not working..
    By dragonmonster in forum World of Warcraft General
    Replies: 0
    Last Post: 10-24-2006, 06:29 PM
  4. weird model edits not working :S
    By nozzie in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-20-2006, 08:51 AM
  5. WoW Glider, key not working?
    By Shadowman2418 in forum World of Warcraft General
    Replies: 3
    Last Post: 07-28-2006, 03:49 AM
All times are GMT -5. The time now is 07:34 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved. Digital Point modules: Sphinx-based search