Error help?! menu

Shout-Out

User Tag List

Thread: Error help?!

Results 1 to 8 of 8
  1. #1
    weezyC's Avatar Sergeant Major
    Reputation
    33
    Join Date
    Mar 2010
    Posts
    154
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error help?!

    Getting the Error:
    Code:
    lua:193: attempt to index global 'Siantsu" (a nil value)
    Script:

    Code:
    local Thrall_Id = 80006
    local Azaloth_Id = 80007
    
    		--Thrall OnDeath Spawn Azaloth
    function Thrall_OnDeath(unit, event)
    unit:SendChatMessage(12, 0, "This city will not fall to the Alliance! Azaloth, rid this city of Alliance!")
    unit:SpawnCreature(80007, unit:GetX(), unit:GetY(), unit:GetZ(), unit:GetO(), 1734, 600000)
    end
    		--Function OnLoads
    function Azaloth_OnLoad(unit, event)
    	Azaloth = unit
    end
    
    function VolJin_OnLoad(unit, event)
    	VolJin = unit
    end
    
    function Eltrigg_OnLoad(unit, event)
    	Eltrigg = unit
    end
    
    function Mokvar_OnLoad(unit, event)
    	Mokvar = unit
    end
    
    function Pyreanor_OnLoad(unit, event)
    	Pyreanor = unit
    end
    
    function Dawnsinger_OnLoad(unit, event)
    	Dawnsinger = unit
    end
    
    function Searn_OnLoad(unit, event)
    	Searn = unit
    end
    
    function Siantsu_OnLoad(unit, event)
    	Siantsu = unit
    end
    
    function Sagorne_OnLoad(unit, event)
    	Sagorne = unit
    end
    
    function Kardris_OnLoad(unit, event)
    	Kardris = unit
    end
    
    function Zor_OnLoad(unit, event)
    	Zor = unit
    end
    
    function Asoran_OnLoad(unit, event)
    	Asoran = unit
    end
    
    function Magenius_OnLoad(unit, event)
    	Magenius = unit
    end
    
    function VuShalay_OnLoad(unit, event)
    	VuShalay = unit
    end
    
    function Jhag_OnLoad(unit, event)
    	Jhag = unit
    end
    
    function Godan_OnLoad(unit, event)
    	Godan = unit
    end
    
    function Kithas_OnLoad(unit, event)
    	Kithas = unit
    end
    
    function KorGeld_OnLoad(unit, event)
    	KorGeld = unit
    end
    
    function Yelmak_OnLoad(unit, event)
    	Yelmak = unit
    end
    
    function Whuut_OnLoad(unit, event)
    	Whuut = unit
    end
    
    function Dran_OnLoad(unit, event)
    	Dran = unit
    end
    
    function Malton_OnLoad(unit, event)
    	Malton = unit
    end
    
    function Zeal_OnLoad(unit, event)
    	Zeal = unit
    end
    
    function Jandi_OnLoad(unit, event)
    	Jandi = unit
    end
    
    function Mirket_OnLoad(unit, event)
    	Mirket = unit
    end
    
    function Kurgul_OnLoad(unit, event)
    	Kurgul = unit
    end
    
    function Grol_OnLoad(unit, event)
    	Grol = unit
    end
    
    function Zevrost_OnLoad(unit, event)
    	Zevrost = unit
    end
    
    function GanRul_OnLoad(unit, event)
    	GanRul = unit
    end
    
    function Hagrus_OnLoad(unit, event)
    	Hagrus = unit
    end
    
    function Muragus_OnLoad(unit, event)
    	Muragus = unit
    end
    
    function Katis_OnLoad(unit, event)
    	Katis = unit
    end
    
    function Craven_OnLoad(unit, event)
    	Craven = unit
    end
    
    function Neeru_OnLoad(unit, event)
    	Neeru = unit
    end
    
    function KorJus_OnLoad(unit, event)
    	KorJus = unit
    end
    
    function KorGhan_OnLoad(unit, event)
    	KorGhan = unit
    end
    
    function Kareth_OnLoad(unit, event)
    	Kareth = unit
    end
    
    function Ormok_OnLoad(unit, event)
    	Ormok = unit
    end
    
    function Rekkul_OnLoad(unit, event)
    	Rekkul = unit
    end
    
    function Gest_OnLoad(unit, event)
    	Gest = unit
    end
    
    function Zando_OnLoad(unit, event)
    	Zando = unit
    end
    
    function Therzok_OnLoad(unit, event)
    	Therzok = unit
    end
    
    function Shenthul_OnLoad(unit, event)
    	Shenthul = unit
    end
    
    
    		--Azaloth OnDeat Faction Changes
    function Azaloth_OnDeath(unit, event)
    if Azaloth:IsDead() == true then
    	VolJin:SetFaction(1732)
    	Eltrigg:SetFaction(1732)
    	Mokvar:SetFaction(1732)
    	Pyreanor:SetFaction(1732)
    	Dawnsinger:SetFaction(1732)
    	Searn:SetFaction(1732)
    	Siantsu:SetFaction(1732)
    	Sagorne:SetFaction(1732)
    	Kardris:SetFaction(1732)
    	Zor:SetFaction(1732)
    	Asoran:SetFaction(1732)
    	Magenius:SetFaction(1732)
    	VuShalay:SetFaction(1732)
    	Jhag:SetFaction(1732)
    	Godan:SetFaction(1732)
    	Kithas:SetFaction(1732)
    	KorGeld:SetFaction(1732)
    	Yelmak:SetFaction(1732)
    	Whuut:SetFaction(1732)
    	Dran:SetFaction(1732)
    	Malton:SetFaction(1732)
    	Zeal:SetFaction(1732)
    	Jandi:SetFaction(1732)
    	Mirket:SetFaction(1732)
    	Kurgul:SetFaction(1732)
    	Grol:SetFaction(1732)
    	Zevrost:SetFaction(1732)
    	GanRul:SetFaction(1732)
    	Hagrus:SetFaction(1732)
    	Muragus:SetFaction(1732)
    	Katis:SetFaction(1732)
    	Craven:SetFaction(1732)
    	Neeru:SetFaction(1732)
    	KorJus:SetFaction(1732)
    	KorGhan:SetFaction(1732)
    	Kareth:SetFaction(1732)
    	Ormok:SetFaction(1732)
    	Rekkul:SetFaction(1732)
    	Gest:SetFaction(1732)
    	Zando:SetFaction(1732)
    	Therzok:SetFaction(1732)
    	Shenthul:SetFaction(1732)
    end
     end
     
    		--RegisterUnitEvents 
    RegisterUnitEvent(80006, 4, "Thrall_OnDeath")
    RegisterUnitEvent(80007, 4, "Azaloth_OnDeath")
    RegisterUnitEvent(80007, 18, "Azaloth_OnLoad")
    RegisterUnitEvent(10540, 18, "VolJin_OnLoad")
    RegisterUnitEvent(3144, 18, "Eltrigg_OnLoad")
    RegisterUnitEvent(16012, 18, "Mokvar_OnLoad")
    RegisterUnitEvent(23128, 18, "Pyreanor_OnLoad")
    RegisterUnitEvent(17098, 18, "Dawnsinger_OnLoad")
    RegisterUnitEvent(5892, 18, "Searn_OnLoad")
    RegisterUnitEvent(3403, 18, "Siantsu_OnLoad")
    RegisterUnitEvent(13417, 18, "Sagorne_OnLoad")
    RegisterUnitEvent(3344, 18, "Kardris_OnLoad")
    RegisterUnitEvent(4047, 18, "Zor_OnLoad")
    RegisterUnitEvent(3350, 18, "Asoran_OnLoad")
    RegisterUnitEvent(3351, 18, "Magenius_OnLoad")
    RegisterUnitEvent(15761, 18, "VuShalay_OnLoad")
    RegisterUnitEvent(11066, 18, "Jhag_OnLoad")
    RegisterUnitEvent(3345, 18, "Godan_OnLoad")
    RegisterUnitEvent(3346, 18, "Kithas_OnLoad")
    RegisterUnitEvent(3348, 18, "KorGeld_OnLoad")
    RegisterUnitEvent(3347, 18, "Yelmak_OnLoad")
    RegisterUnitEvent(11046, 18, "Whuut_OnLoad")
    RegisterUnitEvent(6986, 18, "Dran_OnLoad")
    RegisterUnitEvent(6987, 18, "Malton_OnLoad")
    RegisterUnitEvent(3405, 18, "Zeal_OnLoad")
    RegisterUnitEvent(3403, 18, "Jandi_OnLoad")
    RegisterUnitEvent(3325, 18, "Mirket_OnLoad")
    RegisterUnitEvent(5815, 18, "Kurgul_OnLoad")
    RegisterUnitEvent(3324, 18, "Grol_OnLoad")
    RegisterUnitEvent(3326, 18, "Zevrost_OnLoad")
    RegisterUnitEvent(5875, 18, "GanRul_OnLoad")
    RegisterUnitEvent(3335, 18, "Hagrus_OnLoad")
    RegisterUnitEvent(3330, 18, "Muragus_OnLoad")
    RegisterUnitEvent(5816, 18, "Katis_OnLoad")
    RegisterUnitEvent(5639, 18, "Craven_OnLoad")
    RegisterUnitEvent(3216, 18, "Neeru_OnLoad")
    RegisterUnitEvent(3329, 18, "KorJus_OnLoad")
    RegisterUnitEvent(3189, 18, "KorGhan_OnLoad")
    RegisterUnitEvent(3331, 18, "Kareth_OnLoad")
    RegisterUnitEvent(3328, 18, "Ormok_OnLoad")
    RegisterUnitEvent(3334, 18, "Rekkul_OnLoad")
    RegisterUnitEvent(3327, 18, "Gest_OnLoad")
    RegisterUnitEvent(3402, 18, "Zando_OnLoad")
    RegisterUnitEvent(6446, 18, "Therzok_OnLoad")
    RegisterUnitEvent(3401, 18, "Shenthul_OnLoad")
    Please help, I dont see anything wrong with it? And it was working earlier

    Error help?!
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    When it gets to:

    Sagorne:SetFaction(1732)

    On line 193 it doesn't know what Sagorne is, because the unit has gone or was never defined. Hence the nil part (nil means nothing).

    A solution is to either find out why it's nil (was there a typo or something? Is it spawned in game?) or add in nil checks:

    if Sagorne ~= nil then -- If he is there
    Sagorne:SetFaction()
    end
    if X ~= nil...

  3. #3
    weezyC's Avatar Sergeant Major
    Reputation
    33
    Join Date
    Mar 2010
    Posts
    154
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, Idk tried putting that but still didnt work?
    Siantsu and Sagorne are spawned and i have the right spawn ids
    Ill just take them out

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    They might be too far away... The world doesn't load all the creatures at once, it only loads creatures when a player is close enough to them... So if that creature is too far away it won't have loaded and still will be nil.

  5. #5
    weezyC's Avatar Sergeant Major
    Reputation
    33
    Join Date
    Mar 2010
    Posts
    154
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But the thing is the guy right next to him will change and they kill him but then it stops at Siantsu?
    Ill probably just delete those for now and after im done go back respawn them and see if i get any luck

    Edit:Well im about to give up cuz when i took them out it worked up to one of the last functions, But then i took one of them out that it stopped at and now it is giving me a nil value at one of the first functions. Its like its choosing where it wants to stop?
    Last edited by weezyC; 08-08-2010 at 03:41 PM.

  6. #6
    weezyC's Avatar Sergeant Major
    Reputation
    33
    Join Date
    Mar 2010
    Posts
    154
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Stoneharry, is there a way that i could have the db load all the NPCs in a zone at once if you enter that zone?
    Cuz i think you were right when you said it doesnt load all the npcs, cuz after i run around the zone to where they are the script goes fine.
    So is there a way i could have it load the zones npc if you enter the zone?

  7. #7
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Take a look at the 'statistic_spawns' table. These should be spawns that you can see from anywhere on the same map and always stay loaded - but I have never tested it personally.

  8. #8
    weezyC's Avatar Sergeant Major
    Reputation
    33
    Join Date
    Mar 2010
    Posts
    154
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, ill give it a try. Thanks for the help

Similar Threads

  1. WebSite Error Help?
    By spookster in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-05-2008, 10:37 PM
  2. Compiling errors {help plz lol}
    By jokerjokes in forum World of Warcraft Emulator Servers
    Replies: 30
    Last Post: 02-19-2008, 09:44 PM
  3. error help
    By az121 in forum World of Warcraft Emulator Servers
    Replies: 17
    Last Post: 01-25-2008, 04:05 PM
  4. microsoft Visual Studios ERROR help PLEASE
    By Nextgenerationrepack! in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 10-10-2007, 04:07 PM
  5. WoW Error Help please!
    By Bazerke in forum World of Warcraft General
    Replies: 4
    Last Post: 06-26-2007, 07:37 PM
All times are GMT -5. The time now is 02:43 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search