[Help] One part of my lua script doesn't work correctly menu

Shout-Out

User Tag List

Results 1 to 11 of 11
  1. #1
    dude891's Avatar Member
    Reputation
    26
    Join Date
    Nov 2007
    Posts
    156
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] One part of my lua script doesn't work correctly

    I made a lua script, here it is:

    Code:
    function Hand_ShadowBoltVolley(pUnit, Event) 
      pUnit:FullCastSpellOnTarget(45770, pUnit:GetMainTank()) 
    end
    Code:
      function Hand_Phase1(pUnit, Event)
        pUnit:RegisterEvent("Hand_ShadowBoltVolley", 20000, 0)
      pUnit:RegisterEvent("Hand_ShadowInfusion", 1000, 0)
    end
    
    function Hand_ShadowInfusion(pUnit, Event)
     if pUnit:GetHealthPct() < 20 then
      pUnit:CastSpell(45772)
     end
    end
    
    function Hand_Entercombat(pUnit, Event)
      pUnit:RemoveAura(30540)
      pUnit:RegisterEvent("Hand_Phase1", 1000, 0)
    end
    
    function Hand_Leavecombat(pUnit, Event)
      pUnit:RemoveEvents()
      pUnit:CastSpell(30540)
    end
    
    function Hand_Died(pUnit, Event)
      pUnit:SpawnCreature(25320, 1698.799072, 628.254517, 27.533756, 5.559829, 1771, 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)
    end
    
    function Hand_Spawn(pUnit, Event)
      pUnit:CastSpell(30540)
    end
    
    RegisterUnitEvent(25321, 1, "Hand_Entercombat")
    RegisterUnitEvent(25321, 2, "Hand_Leavecombat")
    RegisterUnitEvent(25321, 4, "Hand_Died")
    RegisterUnitEvent(25321, 6, "Hand_Spawn")
    The mob is supposed to cast Shadow Bolt Volley every 20 seconds at one part. Instead, it waits 20 seconds then it starts casting about every millisecond I believe. Can anyone tell me what I'm doing wrong?

    Edit: Sorry that the post got a little messed up. The edit feature isn't working that good for some things.
    Last edited by dude891; 06-03-2008 at 03:48 PM.
    Remember, there's no such thing as a stupid question, just stupid people!

    [Help] One part of my lua script doesn't work correctly
  2. #2
    Power of Illuminati's Avatar Contributor
    Reputation
    179
    Join Date
    May 2008
    Posts
    1,410
    Thanks G/R
    6/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure, but the variables doesn't match eachother

    pUnit:RegisterEvent("Hand_ShadowBoltVolley", 20000, 0)
    function Hand_ShadowBoltVolley(pUnit, Event)
    I think you need to add something to the function name, like cooldown (or something like that)
    function Hand_ShadowBoltVolley(pUnit, Event, Cooldown)
    (Note that I have no clue if Cooldown is the right variable to add)

  3. #3
    Gastricpenguin's Avatar Legendary
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Proper script:

    Code:
        local plr = pUnit:GetMainTank()
           if (plr ~= nil) then
            pUnit:FullCastSpellOnTarget(45770, plr) 
        end
    Life Puzzler WoW - Website | Forums

  4. #4
    bill45's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The way you do your script to me is confusing but i think the problem is this(red part)

    Code:
    function Hand_Entercombat(pUnit, Event)
      pUnit:RemoveAura(30540)
      pUnit:RegisterEvent("Hand_Phase1", 1000, 0)

    Which means knowing there is only one phase it means your telling him to cast it or do that phase every second.

  5. #5
    dude891's Avatar Member
    Reputation
    26
    Join Date
    Nov 2007
    Posts
    156
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Gastricpenguin View Post
    Proper script:

    Code:
        local plr = pUnit:GetMainTank()
           if (plr ~= nil) then
            pUnit:FullCastSpellOnTarget(45770, plr) 
        end

    Knowing you this will most likely work. The only problem is I'm a noob to this stuff and don't know where or how to put this in my script. Can you explain it a little bit more to me? I'm new to this and still learning.
    Remember, there's no such thing as a stupid question, just stupid people!

  6. #6
    bill45's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You just put it in there like this.

    Code:
    function Hand_ShadowBoltVolley(pUnit, Event) 
    local plr = pUnit:GetMainTank()
           if (plr ~= nil) then
            pUnit:FullCastSpellOnTarget(45770, plr) 
        end
    end

  7. #7
    dude891's Avatar Member
    Reputation
    26
    Join Date
    Nov 2007
    Posts
    156
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know what's wrong. I tried that piece of code gastric but it still continues to wait 20 seconds before casting the spell every millisecond.
    Remember, there's no such thing as a stupid question, just stupid people!

  8. #8
    Bapesy's Avatar Banned
    Reputation
    35
    Join Date
    May 2008
    Posts
    126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Be more specific on what you need fixed.

    Bapes

    Edit: What LUA engine are you using?

  9. #9
    bill45's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a guess but try setting this

    Code:
      pUnit:RegisterEvent("Hand_Phase1", 1000, 0)
    to this

    Code:
     pUnit:RegisterEvent("Hand_Phase1", 1000, 1)
    tell me if that stops the non stop shadow bolts.

  10. #10
    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)
    *sigh*
    Here's your problem.

    As the mob enters battle, the function Hand_Phase1 gets called every second.
    Function Hand_Phase1 registers the volley to be every 20 seconds.
    BUT because it gets called every 1 second, after 20 seconds you'll have 20 events with 20 second interval and 1 second between each one.

  11. #11
    dude891's Avatar Member
    Reputation
    26
    Join Date
    Nov 2007
    Posts
    156
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks it worked. I just wasn't using my mind right. +Rep
    Remember, there's no such thing as a stupid question, just stupid people!

Similar Threads

  1. [ArcEmu] Custom Lua Scripted Boss (Not working!)
    By shtriga in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 11-29-2013, 04:31 PM
  2. [Lua Script] Lua scripts won't work!
    By Leksikon in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 05-17-2011, 05:08 PM
  3. Nogg-it UI doesn't work correctly..
    By Nitewolf in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 02-01-2010, 09:06 AM
  4. [Help] Need someone to check LUA script
    By stealthpyro in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-21-2008, 09:50 AM
  5. [Release Lua] One of My First Lua Scripts
    By Juicyz in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 03-28-2008, 02:03 AM
All times are GMT -5. The time now is 08:23 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