So today I decided I would learn LUA to script bosses in my server. (It's a local server). I read the guide by Thekal (http://www.mmowned.com/forums/emulat...-tutorial.html) and decided I would make a simple script. So I took about 10-15 minutes writing it up and looking back at references and then I thought before I got deeper into it I would test it out. So I made my NPC and put in my script and it didnt load. I've had SEVERAL reasons it didnt, but I just cant get it to load the script.
If you could analyze this and tell me what problems its infested with, that'd be great. I'll delete this when I'm done and rep whoever got it working. Hopefully I'll learn from this.Code:function Demon_OnCombat(Unit,Event) Unit:SendChatMessage(14,0,"Entering Combat") end function Demon_OnDeath(Unit,Event) Unit:SendChatMessage(14,0,"I have died") Unit:ClearEvents() end function Demon_OnReset(Unit,Event) Unit:Sendchatmessage(14,0,"See you later.") Unit:ClearEvents() end function Demon_OnKill(Unit,Event) Unit:SendChatMessage(12,0,"Another one bites the dust") end function Demon_Shadowbolt(Unit,Event) Unit:FullCastSpellOnTarget(47809,Unit:GetMainTank()) end function Phase_2(Unit,Event) if Unit:GetHealthPct() <= 40 then Unit:SendChatMessage(14,0,"PHASE TWO") Unit:SetModel(999) Unit:SetScale(3) Unit:CastSpell(30330) Unit:CastSpell(47867) end end RegisterUnitEvent(60000,1,"Demon_OnCombat") RegisterUnitEvent(60000,4,"Demon_OnDeath") RegisterUnitEvent(60000,2,"Demon_OnReset") RegisterUnitEvent(60000,3,"Demon_OnKill") RegisterUnitEvent("Demon_Shadowbolt",50000,5) end
Thanks in advance!
Edit: I have another question, I was wondering if, in LUA, using caps matter or not. (Like if it mattered if I write "Function Demon_OnCombat" or "function Demon_OnCombat")
EDIT 2: So I added end to the end of the registering section and now it will load my script... but it doesnt work. I still need your help!