[HELP] Ending a lua script menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Ezikielth's Avatar Banned
    Reputation
    43
    Join Date
    Aug 2007
    Posts
    96
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [HELP] Ending a lua script

    Whenever I create a script for an NPC in an Instance and the group whipes, the script doesnt end and when the group pulls the boss a second time he creates a second running of the script and then is 2x as hard because hes running two scrips and spamming. Im using unit: functions.

    Code:
    function Faralash_Enrage(Unit, event, miscunit, misc)
        if Unit:GetHealthPct() < 30 and Didthat == 0 then
            Unit:FullCastSpell(44779)
            Didthat = 1
        end
    end
    
    function Faralash_Gouge(Unit, event, miscunit, misc)
        print "Faralash Gouge"
           Unit:SendChatMessage(12, 0, "Fall into your stooper...")
        Unit:FullCastSpellOnTarget(28456,Unit:GetClosestPlayer())
    end
    
    function Faralash_Charge(Unit, event, miscunit, misc)
        print "Faralash Charge"
        Unit:FullCastSpellOnTarget(29320,Unit:GetRandomPlayer(1))
        Unit:FullCastSpellOnTarget(30584,Unit:GetRandomPlayer(1))
        Unit:SendChatMessage(12, 0, "Yes, run! It makes the blood pump faster!")
        Unit:PlaySoundToSet(8787)
    end
    
    function Faralash_Vanish(Unit, event, miscunit, misc)
        print "Faralash Vanish"
        Unit:FullCastSpell(10389)
        Unit:FullCastSpell(9458)
        Unit:SendChatMessage(12, 0, "Where to go? What to do? So many choices that all end in pain, end in death.")
        Unit:PlaySoundToSet(8791)
    end
    
    function Faralash_Garrote(Unit, event, miscunit, misc)
        print "Faralash Garrote"
        Unit:FullCastSpellOnTarget(28456,Unit:GetClosestPlayer())
        Unit:SendChatMessage(12, 0, "Closer now... tasty morsels. I've been too long without food. Without blood to drink.")
        Unit:PlaySoundToSet(8793)
    end
    
    function Faralash(unit, event, miscunit, misc)
        print "Faralash"
        unit:RegisterEvent("Faralash_Enrage",1000,1)
        unit:RegisterEvent("Faralash_Gouge",15000,0)
        unit:RegisterEvent("Faralash_Charge",30000,0)
        unit:RegisterEvent("Faralash_Vanish",50000,0)
        unit:RegisterEvent("Faralash_Garrote",69000,0)
    end
    
    RegisterUnitEvent(50900,1,"Faralash")

    [HELP] Ending a lua script
  2. #2
    EcHoEs's Avatar lol why u mad
    Reputation
    374
    Join Date
    Sep 2006
    Posts
    1,646
    Thanks G/R
    3/1
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Faralash_Enrage(Unit, event, miscunit, misc)
        if Unit:GetHealthPct() < 30 and Didthat == 0 then
            Unit:FullCastSpell(44779)
            Didthat = 1
        end
    end
    
    function Faralash_Gouge(Unit, event, miscunit, misc)
        print "Faralash Gouge"
           Unit:SendChatMessage(12, 0, "Fall into your stooper...")
        Unit:FullCastSpellOnTarget(28456,Unit:GetClosestPlayer())
    end
    
    function Faralash_Charge(Unit, event, miscunit, misc)
        print "Faralash Charge"
        Unit:FullCastSpellOnTarget(29320,Unit:GetRandomPlayer(1))
        Unit:FullCastSpellOnTarget(30584,Unit:GetRandomPlayer(1))
        Unit:SendChatMessage(12, 0, "Yes, run! It makes the blood pump faster!")
        Unit:PlaySoundToSet(8787)
    end
    
    function Faralash_Vanish(Unit, event, miscunit, misc)
        print "Faralash Vanish"
        Unit:FullCastSpell(10389)
        Unit:FullCastSpell(9458)
        Unit:SendChatMessage(12, 0, "Where to go? What to do? So many choices that all end in pain, end in death.")
        Unit:PlaySoundToSet(8791)
    end
    
    function Faralash_Garrote(Unit, event, miscunit, misc)
        print "Faralash Garrote"
        Unit:FullCastSpellOnTarget(28456,Unit:GetClosestPlayer())
        Unit:SendChatMessage(12, 0, "Closer now... tasty morsels. I've been too long without food. Without blood to drink.")
        Unit:PlaySoundToSet(8793)
    end
    
    function Faralash(unit, event, miscunit, misc)
        print "Faralash"
        unit:RegisterEvent("Faralash_Enrage",1000,1)
        unit:RegisterEvent("Faralash_Gouge",15000,0)
        unit:RegisterEvent("Faralash_Charge",30000,0)
        unit:RegisterEvent("Faralash_Vanish",50000,0)
        unit:RegisterEvent("Faralash_Garrote",69000,0)
    end
    
    function Faralash_LeaveCombat(Unit, Event) 
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(50900,1,"Faralash")
    RegisterUnitEvent(50900,2,"Faralash_LeaveCombat")
    There you go


Similar Threads

  1. [Lua Script] Need some help with my lua script
    By riizu in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 07-13-2010, 01:40 AM
  2. [Help] Problem mit lua script
    By Zerodead in forum World of Warcraft General
    Replies: 0
    Last Post: 03-15-2010, 04:18 PM
  3. Need help with an LUA script.
    By Ryoken in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 06-21-2009, 09:30 PM
  4. [Help] Fairly large Lua script problem
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 03-16-2008, 09:03 PM
  5. Help with this LUA script
    By jordash in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 03-08-2008, 04:19 PM
All times are GMT -5. The time now is 11:17 PM. 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