So first here's my script:
Code:function Keleth_Announce (Unit, Event) Unit:SendChatMessage(11, 0, "It seems that some classes are missing spells... Click on me to get them!") end function Keleth_MainMenu (Unit, Player) Unit:GossipCreateMenu(99970, Player) Unit:GossipMenuAddItem(Player, 3, "Teach me my spells!", 1, 0) Unit:GossipSendMenu(Player) end function Keleth_OnGossipSelect (Unit, event, Player, id, intid, code) --[[ Classes WARRIOR = 1, PALADIN = 2, HUNTER = 3, ROGUE = 4, PRIEST = 5, SHAMAN = 7, MAGE = 8, WARLOCK = 9, DRUID = 11, ]]-- local pc = Player:GetPlayerClass() if(pc == 11) then --Druid Player:LearnSpell(9634) --Dire Bear Form Player:LearnSpell(40120) --Swift Flight Form Player:LearnSpell(26996) --Maul (Rank 8) Player:LearnSpell(33745) --Lacerate (Rank 1) Player:LearnSpell(26999) --Frenzied Regeneration (Rank 4) Player:LearnSpell(26997) --Swipe (Rank 6) Player:LearnSpell(26998) --Demoralizing Roar (Rank 6) Player:LearnSpell(8983) --Bash (Rank 3) Player:LearnSpell(1066) --Aquatic Form elseif(pc == 3) then --Hunter Player:LearnSpell(5149) --Beast Training Player:LearnSpell(883) --Call Pet Player:LearnSpell(2641) --Dismiss Pet Player:LearnSpell(6991) --Feed Pet Player:LearnSpell(982) --Revive Pet Player:LearnSpell(1515) --Tame Beast elseif(pc == 2) then --Paladin Player:LearnSpell(20773) --Redemption (Rank 5) Player:LearnSpell(34767) --Summon Charger (Horde) Player:LearnSpell(23214) --Summon Charger (Ally) elseif(pc == 9) then --Warlock Player:LearnSpell(688) --Summon Imp Player:LearnSpell(697) --Summon Voidwalker Player:LearnSpell(712) --Summon Succubus Player:LearnSpell(691) --Summon Felhunter Player:LearnSpell(23161) --Summon Dreadsteed elseif(pc == 1) then --Warrior Player:LearnSpell(2458) --Berserker Stance Player:LearnSpell(355) --Taunt Player:LearnSpell(25275) --Intercept (Rank 5) Player:LearnSpell(71) --Defensive Stance elseif(pc == 8) then --Mage Player:LearnSpell(45438) --Ice Block else Unit:SendChatMessage(11, 0, "I have no spells to teach you.") end Player:GossipComplete() end function Keleth_OnSpawn(Unit, Event) Unit:RegisterEvent("Keleth_Announce", 180000, 0) end RegisterUnitEvent(100000, 6, "Keleth_OnSpawn") RegisterGossipEvent(100000, 1, "Keleth_MainMenu") RegisterGossipEvent(100000, 2, "Keleth_OnGossipSelect")
And here is the error:
Anyone know? +Rep for help!Code:scriptsmissing_spells_trainer.lua:6: bad argument #1 to 'GossipCreateMenu' (Unit expected, got number)