LUA script not working menu

User Tag List

Results 1 to 13 of 13
  1. #1
    pedobear123's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA script not working

    i have made a script for my own boss and the first add spawn works but the second add spawn doesnt :S and i real dont know why.


    function Dynith_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "May the frost goddess take you in here frozen grasp")
    Unit:RegisterEvent("Dynith_FrostBreath", 19000, 0)
    Unit:RegisterEvent("Dynith_whelps",1000,0)
    Unit:RegisterEvent("Dynith_whelps2",1000,0)
    Unit:RegisterEvent("Dynith_FrostBreath", 19000, 0)
    end

    function Dynith_FrostBreath(pUnit, Event)
    pUnit:FullCastSpellOnTarget(44799, pUnit:GetClosestPlayer())
    end

    function FrostWhelp_Spawn(pUnit, Event)
    pUnit:SpawnCreature(20002, -98.456596, 147.296814, -40.376171, 6.22597, 21, 5000000)
    end

    function FrostWhelp2_Spawn2(pUnit, Event)
    pUnit:SpawnCreature(20002, -98.456596, 147.296814, -40.376171, 6.22597, 21, 5000000)
    end

    function Dynith_FrostBreath(pUnit, Event)
    pUnit:FullCastSpellOnTarget(44799, pUnit:GetClosestPlayer())
    end

    function Dynith_FrostBreath(pUnit, Event)
    pUnit:FullCastSpellOnTarget(44799, pUnit:GetClosestPlayer())
    end

    function Dynith_whelps(pUnit, Event)
    if pUnit:GetHealthPct() < 76 then
    pUnit:RemoveEvents();
    pUnit:FullCastSpell(0)
    pUnit:RegisterEvent("FrostWhelp_Spawn",1000,5)
    pUnit:RegisterEvent("Dynith_FrostBreath", 17000, 0)
    end
    end

    function Dynith_whelps2(pUnit, Event)
    if pUnit:GetHealthPct() < 51 then
    pUnit:RemoveEvents();
    pUnit:FullCastSpell(0)
    pUnit:RegisterEvent("FrostWhelp2_Spawn3",1000,6)
    pUnit:RegisterEvent("Dynith_FrostBreath", 17000, 0)
    end
    end

    function _OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end

    function Dynith_OnDied(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "Free... at last")
    end

    function Dynith_OnKilledTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "Another falls to the forsaken")
    end

    RegisterUnitEvent(20001, 1, "Dynith_OnCombat")
    RegisterUnitEvent(20001, 2, "Dynith_OnLeaveCombat")
    RegisterUnitEvent(20001, 3, "Dynith_OnKilledTarget")
    RegisterUnitEvent(20001, 4, "Dynith_OnDied")


    This is the script , please help +Rep given
    Last edited by pedobear123; 08-29-2008 at 04:27 PM.

    LUA script not working
  2. #2
    pedobear123's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bump: almost a day no reply

  3. #3
    Ferag's Avatar Contributor
    Reputation
    263
    Join Date
    Jul 2007
    Posts
    1,437
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe this belongs in the emu servers help section.

    At least I think there's a section for that stuff.

  4. #4
    Exacute's Avatar Active Member
    Reputation
    67
    Join Date
    Mar 2008
    Posts
    337
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    first:
    why do it cast spell 0
    pUnit:FullCastSpell(0)
    second, it should be pUnit, not Unit

    and third
    Unit:RegisterEvent("Dynith_whelps2",1000,0)
    it should be a higher number.. else it will make them spawn in each other :P

    Last edited by Exacute; 08-30-2008 at 02:44 PM.
    [/COLOR]

  5. #5
    pedobear123's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Exacute View Post


    second, it should be pUnit, not Unit

    Which bit?

  6. #6
    Exacute's Avatar Active Member
    Reputation
    67
    Join Date
    Mar 2008
    Posts
    337
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function _OnLeaveCombat(Unit, Event)
    Heeh u forgot to put "Dynith" in front:
    function Dynith_OnLeaveCombat
    OMG im right in that you have taken this from different scripts right 0.o
    However the only time (as far as i remember) that you use Unit is when it are supposed to cast the spell on itself.. and in this case: there arent anything like that, so change all Unit to pUnit in the script

    ~~Exa
    [/COLOR]

  7. #7
    pedobear123's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Exacute View Post


    OMG im right in that you have taken this from different scripts right 0.o

    nah my mates showed me this lua script generator and i used that

  8. #8
    Exacute's Avatar Active Member
    Reputation
    67
    Join Date
    Mar 2008
    Posts
    337
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ahh yea.. not giving the best scripts :P
    well it works now?
    [/COLOR]

  9. #9
    pedobear123's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry just got home to test it when i changed all the units to punits it didnt work at all any other ideas?

  10. #10
    Exacute's Avatar Active Member
    Reputation
    67
    Join Date
    Mar 2008
    Posts
    337
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm maybe its your version.. then try change all the pUnits to what it were before .. add all other changes i gave.. and test it again XD
    [/COLOR]

  11. #11
    pedobear123's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it already has all your changes except canging units to punits

  12. #12
    pedobear123's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    woot! i did it myself after a while of looking at it, changing something slighty and then testingit.

    I moved

    "pUnit:RegisterEvent("Dynith_whelps2",1000,0)"
    to
    "function Dynith_whelps(pUnit, Event)"

    and now it is working thanks for the help anyway +Rep

  13. #13
    Exacute's Avatar Active Member
    Reputation
    67
    Join Date
    Mar 2008
    Posts
    337
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh yea Lmao.. now i see it :P Gj finding it by uself ..
    anyway thanks for rep :P
    [/COLOR]

Similar Threads

  1. [Lua Script] Lua Script Not Working
    By drpwnage77 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 06-23-2010, 05:50 PM
  2. Halp please lua script not working
    By thebigman in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 09-29-2009, 06:06 PM
  3. LUA script not working
    By Dz The Rage in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 04-04-2009, 09:26 PM
  4. [Help] Lua Script Not Working
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 26
    Last Post: 03-16-2008, 02:13 PM
  5. Simple Lua Script , not working need help!
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 12-30-2007, 02:06 PM
All times are GMT -5. The time now is 02:47 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search