Hello i got a problem with my lua script help my! :O this is the lua script sorry for posted in no code :/
function GodOfWar_OnCombat(Unit, Event)
unit:SendChatMessage(12, 0, "i will crush everybody in my way! you are finished!")
unit:RegisterEvent(150002, "GodOfWar_Stomp", 50000, 3)
unit:RegisterEvent(150002, "GodOfWar_Earthquake", 120000, 5)
unit:RegisterEvent(150002, "GodOfWar_Crushing Leap", 90000, 6)
unit:RegisterEvent(150002, "GodOfWar_SummonPlayer", 60000, 2)
end
function GodOfWar_OnLeaveCombat(Unit, Event)
unit:SendChatMessage(12, 0, "Run like chickens! like i always say, you are no match for me! and my power!")
unit:RemoveEvents()
end
function GodOfWar_OnDied(Unit, Event)
unit:SendChatMessage(12, 0, "NO! this cannot been true? how did i fail?!")
unit:RemoveEvents()
end
function GodOfWar_OnKilledTarget(Unit, Event)
unit:SendChatMessage(12, 0, "HaHa! Rest in hell!")
end
function GodOfWar_Stomp(Unit, Event)
unit:FullCastSpellOnTarget(58663, Unit:GetRandomPlayer(0))
end
function GodOfWar_CrushingLeap(Unit, Event)
unit:FullCastSpellOnTarget(58963, Unit:GetRandomPlayer(0))
end
function GodOfWar_sunbeam(Unit, Event)
unit:CastSpell(62872, Unit:GetMainTank())
end
unit:RegisterEvent(150002, "GodOfWar_sunbeam", 50000, 3)
function GodOfWar_Earthquake(Unit, Event)
unit:FullCastSpellOnTarget(19798, Unit:GetRandomPlayer(0))
end
function GodOfWar_SummonPlayer(Unit, Event)
unit:FullCastSpellOnTarget(20477, Unit:GetRandomPlayer(0))
end
RegisterUnitEvent(150002, 3,"GodOfWar_OnKilledTarget")
RegisterUnitEvent(150002, 4,"GodOfWar_OnDied")
RegisterUnitEvent(150002, 2,"GodOfWar_OnLeaveCombat")
RegisterUnitEvent(150002, 1,"GodOfWar_OnCombat")
it says in world : 19:15 N [Arcemu] LuaEngine: scripts/xzgodofwar.lua. . . failed <could not run> scripts/xzgodofwar.lua:34: attempt to index global 'unit' <a nil value> what is the problem? make it a noob friendly answer xD