Lua Help menu

User Tag List

Thread: Lua Help

Results 1 to 4 of 4
  1. #1
    Moaradin's Avatar Contributor
    Reputation
    163
    Join Date
    Feb 2008
    Posts
    439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua Help

    Hi guys. I need a bit of help with this Lua script im making. Im a bit new at it so I am wondering a few things.
    I am trying to make a boss as blizzlike as possible.. Soo, the boss has some things he says. I understand functions like OnLeaveCombat and OnKillTarget.. I have the PlaySound for those functions..

    But the last thing I need is so the NPC says something every minute or so. Without you being in combat, or anything. Maybe if you are if the same area as him or something. If this is possible, can you also make him have a chance to say multiple things every Minute or so?

    please explain. Srry if this sounds a bit confusing.

    +rep people who help you

    Lua Help
  2. #2
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use the pUnit:RegisterEvent(nameoffunctionyouregister, time in milliseconds, how many times you want your npc to say something in the time you specified)

    then

    function nameoffunctionyouregister(pUnit, Event)
    blah blah blah. Don't register this one like all the others. I don't think that made any sense.

  3. #3
    Moaradin's Avatar Contributor
    Reputation
    163
    Join Date
    Feb 2008
    Posts
    439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not much lol.. the problem is I dont know the name of the function or if it even exist =O

    Need some help on it

    +rep people who help you

  4. #4
    BrantX's Avatar Contributor
    Reputation
    205
    Join Date
    Jul 2007
    Posts
    899
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Simple.

    Code:
    function Boss_OnSpawn(Unit,Event)
    Unit:RegisterEvent("Talk", 60000, 0) -- 60000 = 1 Min.
    end
    
    function Talk(Unit,Event)
    local choice = math.random(1,5)
      if (choice == 1) then
          Unit:SendChatMessage(14, 0, "Whatever you want")
    elseif (choice == 2) then
          Unit:SendChatMessage(14, 0, "Whatever you want")
    elseif (choice == 3) then
           Unit:SendChatMessage(14, 0, "Whatever you want")
    elseif (choice == 4) then
           Unit:SendChatMessage(14, 0, "Whatever you want")
    elseif (choice == 5) then
           Unit:SendChatMessage(14, 0, "Whatever you want")
    end
    end
    RegisterUnitEvent(EntryID, 18, "Boss_OnSpawn")
    
    Last edited by BrantX; 04-13-2009 at 12:53 AM.



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. LUA help
    By stoneharry in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 02-25-2008, 03:27 PM
  4. Lua help
    By reconz in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-18-2008, 07:03 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 04:13 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