Basic LUA guide =] menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    nickelo's Avatar Active Member
    Reputation
    56
    Join Date
    Aug 2007
    Posts
    463
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Basic LUA guide =]

    Welcome to this LUA guide, After this guide, you should be able to speak some LUA, you may not be as good as some of the pro's but you should atleast get the point of LUA.


    First of all, When you are going to start a LUA script, you must make it a function
    I.E
    Code:
     function mob_phaseone (pUnit, Event)

    That would be the function of it.
    Then lets say you wanted it to make it say something? well then you put put
    Code:
    pUnit:SendChatMessage (TYPE , LANGUAGE , "MESSAGE")
    end
    RegisterUnitEvent (4, 0, "FUNCTION NAME"
    Code:
    1 = Enter Combat
    2 = Leave Combat
    3 = Killed Target
    4 = Died
    5 = AI Tick
    6 = Spawn
    7 = Gossip Talk
    8 = Reach Waypoint
    9 = On Leave Limbo
    10 = Player Enters Range
    Code:
    -1 = ADDON
    0 = SAY
    1 = PARTY
    2 = RAID
    3 = GUILD
    4 = OFFICER
    5 = YELL
    6 = WHISPER
    7 = WHISPER_INFORM
    8 = EMOTE
    9 = TEXT_EMOTE
    10 = SYSTEM
    11 = MONSTER_SAY
    12 = MONSTER_YELL
    13 = MONSTER_WHISPER
    14 = CHANNEL
    16 = CHANNEL_JOIN
    17 = CHANNEL_LEAVE
    18 = CHANNEL_LIST
    19 = CHANNEL_NOTICE
    20 = CHANNEL_NOTICE_USER
    21 = AFK
    22 = DND
    23 = COMBAT_LOG
    24 = IGNORED
    25 = SKILL
    32 = LOOT
    83 = BATTLEGROUND_EVENT
    87 = RAIDLEADER
    88 = RAIDWARNING

    Well guys, that's just the basic stuff =]. Once you have mastered that, Please move on to the rest of the guide.


    Lets say you wanted to make it cast a spell? well than do this


    Code:
    function NPCNAME_Spell(pUnit,Event)
        pUnit:CastSpell(SELFBUFFSPELL)
    end
        pUnit:RegisterEvent("NPCNAME_Spell", 25000, 0)

    That would make it cast a spell
    Okay now, lets get back to some easys stuff, like the chat message?


    Code:
    This is an example script
    function boss_sayoncombat (pUnit, Event)
    pUnit:SendChatMessage (1, 0,  "How dare you enter my lair! Now you must pay!")
    end
    RegisterUnitEvent (4, 1, "boss_sayoncombat")
    Okay, that would make the boss say that once it enters combat.


    Lets say you want your boss to spawn a minion ay?
    Well then you would use this:

    :SpawnCreature(entryID, x, y, z, o, faction, duration)

    Remember to use pUnit: and also, remember that LUA is VERY case-sensitive about things, if you mess up with a letter, or even mis-type something, your going to get some errors. GL with your LUA scripts! You can PM me here, or Message me on MSN if you need any help
    [email protected]
    Thats my MSN!
    GL!
    Last edited by nickelo; 09-21-2008 at 03:33 AM.
    Database Evolved Developer:wave:

    Basic LUA guide =]
  2. #2
    spreun123's Avatar Member
    Reputation
    3
    Join Date
    Jul 2008
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice =] helped me out

  3. #3
    nickelo's Avatar Active Member
    Reputation
    56
    Join Date
    Aug 2007
    Posts
    463
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks =] haha
    Database Evolved Developer:wave:

  4. #4
    TheNlghtmare's Avatar Member
    Reputation
    12
    Join Date
    Sep 2008
    Posts
    142
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh man thx great Basic LUA guide!

  5. #5
    nickelo's Avatar Active Member
    Reputation
    56
    Join Date
    Aug 2007
    Posts
    463
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yw =] hope it helped
    Database Evolved Developer:wave:

  6. #6
    nickelo's Avatar Active Member
    Reputation
    56
    Join Date
    Aug 2007
    Posts
    463
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    added some more too it.
    Database Evolved Developer:wave:

  7. #7
    spreun123's Avatar Member
    Reputation
    3
    Join Date
    Jul 2008
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, I like what you did with it. a lot easier to see.

  8. #8
    nickelo's Avatar Active Member
    Reputation
    56
    Join Date
    Aug 2007
    Posts
    463
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks =P..ill be doing more to it soon
    Database Evolved Developer:wave:

  9. #9
    nickdagreatest's Avatar Member
    Reputation
    1
    Join Date
    Oct 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    (lol im such a noob) uhm... what exactly is lua? do you type this in game or something? is there a file, maybe? thanks

    -nic

  10. #10
    nickelo's Avatar Active Member
    Reputation
    56
    Join Date
    Aug 2007
    Posts
    463
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LUA is a programming language used by some games which tells NPC's and Mobs what to do..For instance
    function mob_speak (pUnit, Event)
    pUnit:SendChatMessage (TYPE, LANGUAGE, "Hello Nick!")
    end
    RegisterUnitEvent (9, 0, "mob_Speak")
    That would tell a unit to say Hello Nick =]
    Database Evolved Developer:wave:

  11. #11
    nickdagreatest's Avatar Member
    Reputation
    1
    Join Date
    Oct 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah but like, where exactly would you type dat code? in a file? in game?
    thanks
    -nic

  12. #12
    nickelo's Avatar Active Member
    Reputation
    56
    Join Date
    Aug 2007
    Posts
    463
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In a file, then after your done with your script, name it whatever.lua and put it in your scripts folder then restart =]
    Database Evolved Developer:wave:

  13. #13
    nickdagreatest's Avatar Member
    Reputation
    1
    Join Date
    Oct 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ohhhh i seee thx mate!
    *P.S i lyk ur name!*
    -nick

  14. #14
    nickdagreatest's Avatar Member
    Reputation
    1
    Join Date
    Oct 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and where exactly is your scripts folder located? is it in ur Wow directory or database or summing? thanks for all tha help. also, where can i make a .lua file? is it a word document or suttin?
    -nick
    Last edited by nickdagreatest; 11-04-2008 at 01:50 PM. Reason: needed more help!

  15. #15
    nickdagreatest's Avatar Member
    Reputation
    1
    Join Date
    Oct 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok sorry both problems solved! thanx for ur trouble!
    -nick

Page 1 of 2 12 LastLast

Similar Threads

  1. [Guide] Basic Simple Guide to MyWarcraftStudio Model Editing.
    By -Lex in forum WoW ME Tools & Guides
    Replies: 183
    Last Post: 01-22-2010, 11:13 AM
  2. Basic Macro Guide
    By MetalFan666 in forum World of Warcraft Guides
    Replies: 11
    Last Post: 05-22-2008, 01:49 PM
  3. lua guide on spawning mobs after death
    By runiker in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 03-10-2008, 01:57 AM
  4. LUA guide for ppl who want to learn lua not just copy
    By runiker in forum WoW EMU Guides & Tutorials
    Replies: 2
    Last Post: 02-20-2008, 01:54 AM
All times are GMT -5. The time now is 07:40 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