[Guide]Lua [Beginner] menu

User Tag List

Results 1 to 5 of 5
  1. #1
    ZestyJ's Avatar Contributor
    Reputation
    86
    Join Date
    Mar 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Guide]Lua [Beginner]

    This is a guide about the basics of lua scripting for world of warcraft. Today we will be a making script in which somone or something will say something.

    First, you need to name the event or declare it. It is usually done like this.
    Code:
    function firstname_secondname (Unit, Event, player, id, intid, code, pMisc)
    Second, you need to know what you are going to have the Unit or npc do.
    For the sake of the tutorial i will be making it talk.
    You must add the action and have some ids
    Code:
     11=/say    12=/yell etc...  |  0= commun (languages)
    Here is the code added on...
    Code:
    function firstname_secondname(Unit, Event, player, id, intid, code, pMisc)
    Unit:SendChatMessage(11 or 12, 0, "Your text here")
    Third, you must end the command...
    Code:
    function firstname_secondname(Unit, Event, player, id, intid, code, pMisc)
    Unit:SendChatMessage(11 or 12, 0, "Your text here")
    end
    Last, you must register the even...
    Code:
    function firstname_secondname(Unit, Event, player, id, intid, code, pMisc)
    Unit:SendChatMessage(11 or 12, 0, "Your text here")
    end
    
    RegisterUnitEvent(ENTRYID, 0, "firstname_secondname")
    Replace 0 with the number you like 0 is usually the best...
    CREATURE_EVENT_ON_ENTER_COMBAT = 1,
    CREATURE_EVENT_ON_LEAVE_COMBAT = 2,
    CREATURE_EVENT_ON_TARGET_DIED = 3,
    CREATURE_EVENT_ON_DIED = 4,
    CREATURE_EVENT_ON_TARGET_PARRIED = 5,
    CREATURE_EVENT_ON_TARGET_DODGED = 6,
    CREATURE_EVENT_ON_TARGET_BLOCKED = 7,
    CREATURE_EVENT_ON_TARGET_CRIT_HIT = 8,
    CREATURE_EVENT_ON_PARRY = 9,
    CREATURE_EVENT_ON_DODGED = 10,
    CREATURE_EVENT_ON_BLOCKED = 11,
    CREATURE_EVENT_ON_CRIT_HIT = 12,
    CREATURE_EVENT_ON_HIT = 13,
    CREATURE_EVENT_ON_ASSIST_TARGET_DIED = 14,
    CREATURE_EVENT_ON_FEAR = 15,
    CREATURE_EVENT_ON_FLEE = 16,
    CREATURE_EVENT_ON_CALL_FOR_HELP = 17,
    CREATURE_EVENT_ON_LOAD = 18,
    CREATURE_EVENT_ON_REACH_WP = 19,
    CREATURE_EVENT_ON_LOOT_TAKEN = 20,
    CREATURE_EVENT_ON_AIUPDATE = 21,
    CREATURE_EVENT_ON_EMOTE = 22,

    Then save it as a .lua then put it in your script_bin in your server files.

    Here is a list of other commands.
    http://www.arcemu.info/wiki/index.ph...=Unit_Commands

    I will be making a more advanced version of this later.

    Bai :wave:

    -WickedShadow
    -Zesty
    Formerly Known as Wickedshadow/KingMitch

    [Guide]Lua [Beginner]
  2. #2
    Intu's Avatar Banned
    Reputation
    95
    Join Date
    Feb 2009
    Posts
    303
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This will help a lot of people who are just starting out. +rep.

  3. #3
    ZestyJ's Avatar Contributor
    Reputation
    86
    Join Date
    Mar 2008
    Posts
    169
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does no one think this is usefull?
    -Zesty
    Formerly Known as Wickedshadow/KingMitch

  4. #4
    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)
    Its a nice guide, but the other lua guide is just a lot more in-depth. I think that is the only reason its not getting more support. +Rep though.

  5. #5
    runiker's Avatar Contributor
    Reputation
    105
    Join Date
    Nov 2007
    Posts
    501
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice guide but i think you should make a more in-depth one

Similar Threads

  1. [Lua] Beginners Guide
    By P1raten in forum WoW EMU Guides & Tutorials
    Replies: 9
    Last Post: 04-13-2010, 08:35 AM
  2. [Guide] Lua Scripting Guide is here [Updating]
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 93
    Last Post: 11-04-2008, 06:56 PM
  3. [Guide] LUA Portals
    By Gastricpenguin in forum WoW EMU Guides & Tutorials
    Replies: 83
    Last Post: 08-27-2008, 11:17 PM
  4. guide for beginners
    By soulbleed in forum World of Warcraft Guides
    Replies: 7
    Last Post: 01-07-2008, 12:33 PM
  5. Guide for beginner mac scripters interested in learning how to use Xcode!
    By Domminust in forum World of Warcraft Bots and Programs
    Replies: 13
    Last Post: 05-23-2007, 01:04 AM
All times are GMT -5. The time now is 07:04 AM. 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