i get this message "scripts\king Epirus.lua:40: Bad Argument #1 to 'Fullcastspellontarget' (Unite expected, Got nil)
please i will +Rep if you know how to fix thisCode:--[[ King_Epirus.lua ******************************** * * * The LUA++ Scripting Project * * * ******************************** This software is provided as free and open source by the staff of The LUA++ Scripting Project, in accordance with the AGPL license. This means we provide the software we have created freely and it has been thoroughly tested to work for the developers, but NO GUARANTEE is made it will work for you as well. Please give credit where credit is due, if modifying, redistributing and/or using this software. Thank you. ~~End of License Agreement -- LUA++ staff, April 15, 2008. ]] -- $author: Silent -- Spells: -- Shadowbolt 8439 -- Polymorph 13323 is buggy, I use 12826 -- Detonation 9435 -- Silence 8988 -- ArcaneBubble 9438 function King_EpirusOnCombat(pUnit, Event) print "King_Epirus fight start" pUnit:SendChatMessage(12, 0, "You Shall Suffer Within The Eyes Of King Epirus!") pUnit:PlaySoundToSet(1398) pUnit:RegisterEvent("King_EpirusCast", 6000, 0) end function King_EpirusCast(pUnit, Event) local rndcast = math.random(1,4) if (rndcast == 1) then pUnit:FullCastSpellOnTarget(27209, pUnit:GetRandomPlayer(0)) elseif (rndcast == 2) then pUnit:FullCastSpellOnTarget(12826, pUnit:GetRandomPlayer(0)) -- (7)Not_Main_Tank crash the server elseif (rndcast == 3) then pUnit:FullCastSpellOnTarget(27209, pUnit:GetRandomPlayer(4)) pUnit:RegisterEvent("King_EpirusPhaseTwo", 500, 0) end end function King_EpirusPhaseTwo(pUnit, Event) if (pUnit:GetHealthPct() < 50) then print "King_Epirus phase two start" pUnit:FullCastSpell(9438) pUnit:SendChatMessage(12, 0, "Defile These Peasents!") pUnit:PlaySoundToSet(1396) pUnit:FullCastSpell(30414) pUnit:RemoveEvents() pUnit:RegisterEvent("King_EpirusCast", 5000, 0) end end function King_EpirusOnLeaveCombat(pUnit) print "King_Epirus players dead" pUnit:RemoveEvents() end function King_EpirusOnDied(pUnit) print "King_Epirus dead" pUnit:RemoveEvents() end RegisterUnitEvent(200032, 5, "King_EpirusCast") RegisterUnitEvent(200032, 5, "King_EpirusPhaseTwo") RegisterUnitEvent(200032, 1, "King_EpirusOnCombat") RegisterUnitEvent(200032, 3, "King_EpirusOnLeaveCombat") RegisterUnitEvent(200032, 4, "King_EpirusOnDied")






Reply With Quote



