I just did a simple lua script in notepad and saved it. How do I implement it onto the server? I cant find a guide anywhere
I just did a simple lua script in notepad and saved it. How do I implement it onto the server? I cant find a guide anywhere
save it as a .lua file and then put it in the scripts folder... it should be automatically loaded
Ofcourse if you used lua++ you need their engine!
if the scripts folder does not exist in the arcemu directory then create it![]()
im on arcemu so I c a folder called scripts_bin. Do I put it in there or make a folder called scripts? Im trying this script to work:
Im not sure if "muru" should be a mob ID or what.Code:function muru (pUnit, Event) pUnit:CastSpell (41078) end RegisterUnitEvent muru, 1, "muru"
can you check my new script pls? Cant find out y its not working. I found out how to cast basic stuff but this isnt working
Code:function Hogger_open (pUnit, Event) pUnit:RemoveEvents() pUnit:SendChatMessage(12, 0, Haha, Prepare to get killed!") pUnit:RegisterEvent ("Hogger_Fireball", 20000,1) end function Hogger_Fireball (pUnit, Event) if pUnit:GetHealthPct() < 72 then pUnit:RemoveEvents() pUnit:FullCastSpellOnTarget(40598) pUnit:SendChatMessage (12, 0, "You are not prepared!") pUnit:RegisterEvent ("Hogger_suicide", 20000,1) end end function Hogger_suicide (pUnit, Event) if pUnit:GetHealthPct() < 25 then pUnit:RemoveEvents() pUnit:SetScale(2) pUnit:FullCastSpellOnTarget(45855) pUnit:CastSpell(38166) pUnit:SendChatMessage (12, 0, "NO! I CANNOT DIE!") end end pUnit:RegisterUnitEvent (448, 1, "Hogger_open")
You dont have any of the spells registered...
Such as
pUnit:RegisterEvent("ShadowGnome_Iceflare", 4000, 0)
then
function ShadowGnome_Iceflare (pUnit, event)
pUnit:FullCastSpellOnTarget(3130, pUnit:GetMainTank())
end
Also try
Hogger_EnterCombat or Oncombat instead of Open.
ALso 20k is a fairly long time for a mob like normal hogger that isnt likely gonna live that long.
If you wanna register it in Phases like it seems you do youll need to add in
pUnit:RegisterEvent("Hogger_Phase2", 1000, 0)
pUnit:RegisterEvent("Hogger_Phase3", 1000, 0)
pUnit:RegisterEvent("Hogger_Phase4", 1000, 0)
and so on then instead of
function hogger_fireball you would have
pUnit:RegisterEvent("Hogger_Phase2", 1000, 0)
and then register your events as mentioned above with the Iceflare parts
Look in my profile and add me to MSN if you need further explanations,,
Ty for your help! Not sure exactly how to register spells lol.
Would this work?
Code:function Hogger_open (pUnit, Event) pUnit:RemoveEvents() pUnit:SendChatMessage(12, 0, Haha, Prepare to get killed!") pUnit:RegisterEvent ("Hogger_Fireball", 20000,1) end function pUnit:RegisterEvent("Hogger_Phase2", 1000, 0) if pUnit:GetHealthPct() < 72 then pUnit:RemoveEvents(); pUnit:FullCastSpellOnTarget(40598) pUnit:SendChatMessage (12, 0, "You are not prepared!") end end pUnit:RegisterEvent("Hogger_Phase3", 1000, 0) if pUnit:GetHealthPct() < 25 then pUnit:RemoveEvents(); pUnit:SetScale(2) pUnit:FullCastSpellOnTarget(45855) pUnit:CastSpell(38166) pUnit:SendChatMessage (12, 0, "NO! I CANNOT DIE!") end end pUnit:RegisterUnitEvent (448, 1, "Hogger_open")
Something like that...Code:function Hogger_EnterCombat (pUnit, Event) pUnit:RemoveEvents() pUnit:SendChatMessage(12, 0, Haha, Prepare to get killed!") pUnit:RegisterEvent ("Hogger_Fireball", 20000,1) pUnit:RegisterEvent("Hogger_Phase2", 1000, 0) end function Hogger_Fireball (pUnit, event) pUnit:CastSpell(FIREBALL SPELL ID HERE) end function Hogger_Phase2 (pUnit, event) if pUnit:GetHealthPct() < 72 then pUnit:RemoveEvents(); pUnit:FullCastSpellOnTarget(40598) pUnit:SendChatMessage (12, 0, "You are not prepared!") pUnit:RegisterEvent("Hogger_Phase3", 1000, 0) end end function Hogger_Phase3 (pUnit, event) if pUnit:GetHealthPct() < 25 then pUnit:RemoveEvents(); pUnit:SetScale(2) pUnit:FullCastSpellOnTarget(45855) pUnit:CastSpell(38166) pUnit:SendChatMessage (12, 0, "NO! I CANNOT DIE!") end end pUnit:RegisterUnitEvent (448, 1, "Hogger_EnterCombat")
Thanks again, but it doesn't seem to work. Hogger isnt doing anything differant QQ
Don't forget that in your world config file you can disable/enable lua scripts. Search in notepad "LUA" somthing like this will show up...
LUA- "0"
AS- "0"
Change the 0 to 1.
ahhhh
Its fine. I was working with scripts earlier and they were working. Phases just confuse me like crazy. After all, I learned this stuff today
post the error if you get one...
Is 448 the correct ID for the NPC your trying to use? I'm assuming its Hogger:P. But yeah other than that watch the World window when it loads and post the error here
Yea its 448. I rewrote the script and it seems to be working now. Ill +rep you wen I can =D
When do you put pUnit? and when do you put Unit?