[Help] New to LUA, Need help with script. menu

User Tag List

Results 1 to 3 of 3
  1. #1
    nickelo's Avatar Active Member
    Reputation
    56
    Join Date
    Aug 2007
    Posts
    463
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] New to LUA, Need help with script.

    FIXED, SEE BELOW FOR NEW PROBLEM -_-

    Hi, I'm in the process of learning LUA, It's still a little difficult, but I think I got a grip of it. Heres my script

    function phase_1(pUnit, Event)
    if pUnit:GetHealthPct() < 85 then
    pUnit:RemoveEvents()
    pUnit:GetMainTank()
    pUnit:SendChatMessage (11, 0, "THE SCOURGE IS DOMINANT!")
    pUnit:CastSpellOnTarget(40876)
    pUnit:RegisterEvent("phase_2",1000, 0)
    end
    end

    function phase_2(pUnit, Event)
    if pUnit:GetHealthPct() < 85 then
    pUnit:GetMainTank()
    pUnit:RemoveEvents()
    pUnit:CastSpellOnTarget(40876)
    end
    end

    function Boss_Start(pUnit, Event)
    pUnit:RegisterEvent("phase_1",1000, 0)
    pUnit:SendChatMessage (11, 0, "YOU ARE A FOOL TO CHALLENGE THE DAMNED!")
    end
    RegisterUnitEvent(99012, 1, "Boss_Start")
    It almost works, however, once he reaches 85%, he casts both spells on himself.
    Can someone explain to me what I did wrong? Any help is appreciated.


    My new problem

    heres my new script


    function phase_1(pUnit, Event)
    if pUnit:GetHealthPct() < 85 then
    pUnit:RemoveEvents()
    pUnit:SendChatMessage (11, 0, "THE SCOURGE IS DOMINANT!")
    pUnit:CastSpellOnTarget(40243, pUnit:GetMainTank())
    pUnit:RegisterEvent("phase_2",1000, 0)
    end
    end

    function phase_2(pUnit, Event)
    if pUnit:GetHealthPct() < 82 then
    pUnit:RemoveEvents()
    pUnit:FullCastSpellOnTarget(40876, pUnit:GetMainTank())
    pUnit:RegisterEvent("Phase_3",1000, 0)
    end
    end

    function phase_3(pUnit, Event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:RemoveEvents()
    pUnit:FullCastSpellOnTarget(40876, pUnit:GetMainTank())
    end
    end

    function Boss_Start(pUnit, Event)
    pUnit:RegisterEvent("phase_1",1000, 0)
    pUnit:SendChatMessage (11, 0, "YOU ARE A FOOL TO CHALLENGE THE DAMNED!")
    end
    RegisterUnitEvent(99012, 1, "Boss_Start")
    However, i get this error after phase_2 finnishes,


    (If you can't see it, it says "Tried to call invalid LUA function "Phase_3" from Ascent <Unit>!")

    After the Boss dies, Ascent then proceeds to crash.
    What did I do wrong? Again, thanks for any help.
    Last edited by nickelo; 03-15-2008 at 01:27 AM.

    [Help] New to LUA, Need help with script.
  2. #2
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    pUnit:GetMainTank()
    pUnit:CastSpellOnTarget(40876)

    VV

    pUnit:CastSpellOnTarget(40876, pUnit:GetMainTank())

  3. #3
    nickelo's Avatar Active Member
    Reputation
    56
    Join Date
    Aug 2007
    Posts
    463
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    pUnit:GetMainTank()
    pUnit:CastSpellOnTarget(40876)

    VV

    pUnit:CastSpellOnTarget(40876, pUnit:GetMainTank())


    Worked like a charm.
    Thanks. +Rep

Similar Threads

  1. New to LUA, need some help please.
    By C-Death in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 06-30-2008, 02:37 PM
  2. New to LUA need help with script
    By nickelo in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 06-30-2008, 01:34 PM
  3. New Private Server - Need Help with Scripting Please
    By Xerxe in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 04-14-2008, 09:02 AM
  4. [Help] I need help with Script's
    By PsycoDisciples in forum World of Warcraft Emulator Servers
    Replies: 11
    Last Post: 01-24-2008, 05:20 PM
  5. i need help with script, im a noob
    By orangegold in forum WoW UI, Macros and Talent Specs
    Replies: 2
    Last Post: 10-27-2007, 05:47 PM
All times are GMT -5. The time now is 11:26 AM. 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