Lua help menu

User Tag List

Thread: Lua help

Results 1 to 13 of 13
  1. #1
    reconz's Avatar Member
    Reputation
    3
    Join Date
    Oct 2006
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua help

    Hello there, I'd like some help with a Lua that has an error when I start it. Here it is:
    function Boss_Bolt (pUnit, event)
    pUnit:CastSpell (36972)
    end

    function Boss_Bolt (pUnit, event)
    if pUnit:GetHealthPct() < 99 then
    pUnit:RemoveEvents()
    pUnit:RegisterEvent("Boss_Bolt",10000, 0)
    end
    end


    function Boss_OnCombat(pUnit, event)
    pUnit:RegisterEvent("Boss_Bolt",10000, 0)
    end

    RegisterpUnitEvent(6600003, 1, "Boss_OnCombat")
    The error I get is: 21:15 N LuaEngine: Shadowbolt.lua...
    failed. <could not load>
    scripts\Shadowbolt.lua:17: ')' expected near 'Boss_OnCombat'

    I've sat with it for pretty long but can't see what the error is.... Please help me

    Lua help
  2. #2
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    6600003 is that the id of the boss?
    If you need me you have my skype, if you don't have my skype then you don't need me.

  3. #3
    reconz's Avatar Member
    Reputation
    3
    Join Date
    Oct 2006
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Indeed. (lenght)

  4. #4
    *Alexz*'s Avatar Member
    Reputation
    105
    Join Date
    May 2007
    Posts
    521
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try changeing Boss_OnCombat to Boss_Bolt

  5. #5
    Spartansp's Avatar Member
    Reputation
    644
    Join Date
    Sep 2007
    Posts
    1,803
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by reconz View Post
    Hello there, I'd like some help with a Lua that has an error when I start it. Here it is:
    Code:
                                  
    function Boss_Bolt (pUnit, event)
    pUnit:CastSpell (36972)
    end
     
    function Boss_Bolt (pUnit, event)
    if pUnit:GetHealthPct() < 99 then
    pUnit:RemoveEvents()
    pUnit:RegisterEvent("Boss_Bolt",10000, 0)
    end
    end
     
     
    function Boss_OnCombat(pUnit, event)
    pUnit:RegisterEvent("Boss_Bolt",10000, 0)
    end
     
    RegisterpUnitEvent(6600003, 1, "Boss_OnCombat")
    The error I get is: 21:15 N LuaEngine: Shadowbolt.lua...
    failed. <could not load>
    scriptsShadowbolt.lua:17: ')' expected near 'Boss_OnCombat'

    I've sat with it for pretty long but can't see what the error is.... Please help me

    as you can see you are registering same event two times mate... you on&#241;ly need to register it 1 time just delete one of the register and you should be done, also you have to functions with same name change one of the boss_bolt to boss_bolt1 or whatever

  6. #6
    reconz's Avatar Member
    Reputation
    3
    Join Date
    Oct 2006
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Looks like this now

    It looks like this now
    function Boss_Bolt (pUnit, event)
    pUnit:CastSpell (36972)
    end

    function Boss_Bolt1 (pUnit, event)
    if pUnit:GetHealthPct() < 99 then
    pUnit:RemoveEvents()
    pUnit:RegisterEvent("Boss_Bolt",10000, 0)
    end
    end


    function Boss_OnCombat(pUnit, event)
    pUnit:RegisterEvent("Boss_Bolt1",10000, 0)
    end

    RegisterpUnitEvent(6600003, 1, "Boss_OnCombat")
    it works and all, no error in beggining, but he wont cast any spell :/

  7. #7
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it the correct spell id
    If you need me you have my skype, if you don't have my skype then you don't need me.

  8. #8
    reconz's Avatar Member
    Reputation
    3
    Join Date
    Oct 2006
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes it is.

  9. #9
    Spartansp's Avatar Member
    Reputation
    644
    Join Date
    Sep 2007
    Posts
    1,803
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this one this will work:

    Code:
    function Boss_Bolt(Unit)
    if Unit:GetHealthPct() < 99 then
    Unit:CastSpell(36972)
    end
    end
    
    function Boss_OnCombat(Unit, Event)
        Unit:RegisterEvent("Boss_Bolt",25000, 0)
    end
    end
    
    RegisterUnitEvent(6600003, 1, "Boss_OnCombat")
    Last edited by Spartansp; 02-18-2008 at 06:50 PM.

  10. #10
    reconz's Avatar Member
    Reputation
    3
    Join Date
    Oct 2006
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shadowbolt.lua failed <could not load> scriptsShadowbolt.lua:10: '(eof)'
    expected near 'end' yours says
    Last edited by reconz; 02-18-2008 at 06:56 PM.

  11. #11
    Spartansp's Avatar Member
    Reputation
    644
    Join Date
    Sep 2007
    Posts
    1,803
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well it was mean you to remove some things... well let me make the lua for you .... ok finished and I tested it before so IT WORKS

    Code:
    function Boss_Bolt(Unit)
        if Unit:GetHealthPct() < 99 then
            Unit:CastSpell(36972)
    end
    end
    
    function Boss_OnCombat(Unit, Event)
        Unit:RegisterEvent("Boss_Bolt",25000, 0)
    end
    
    RegisterUnitEvent(6600003, 1, "Boss_OnCombat")
    Last edited by Spartansp; 02-18-2008 at 07:02 PM.

  12. #12
    reconz's Avatar Member
    Reputation
    3
    Join Date
    Oct 2006
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, thank you very much Spartan

  13. #13
    Spartansp's Avatar Member
    Reputation
    644
    Join Date
    Sep 2007
    Posts
    1,803
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no problem mate

Similar Threads

  1. [Help] Need LUA help? Post here!
    By EcHoEs in forum World of Warcraft Emulator Servers
    Replies: 20
    Last Post: 10-03-2010, 01:18 PM
  2. [Help] i need Lua help with this script...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 25
    Last Post: 03-03-2008, 03:45 PM
  3. i need some lua help please
    By runiker in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 02-29-2008, 07:49 AM
  4. LUA help
    By stoneharry in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 02-25-2008, 03:27 PM
  5. Lua help
    By Tom_2001 in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 02-04-2008, 12:17 PM
All times are GMT -5. The time now is 10:09 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