[LUA script] menu

Shout-Out

User Tag List

Thread: [LUA script]

Results 1 to 6 of 6
  1. #1
    Syllabus's Avatar Banned
    Reputation
    22
    Join Date
    Nov 2007
    Posts
    77
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA script]

    Good day!
    Iam kinda new to LUA scripting and Iam trying to make a NPC talk,
    This is my code:
    Code:
    function Yell_OnCombat(Unit, Event) 
    Unit:SendChatMessage(12, 0, "We  are the Legion!")
    end
    RegisterUnitEvent (60000029, 1, "Yell_OnCombat")
    
    function Yell_OnLeaveCombat(Unit, Event) 
    Unit:RemoveEvents() 
    Unit:SendChatMessage(12, 0, "Hah! The legion will survive!") 
    end
    RegisterUnitEvent (60000029, 2, "Yell_OnLeaveCombat")
    
    function death_OnDied(Unit, Event) 
    Unit:RemoveEvents() 
    Unit:SendChatMessage(12, 0, "No! When one fall, ten will come and take his place!") 
    end
    RegisterUnitEvent (60000029, 4, "death_OnDied")
    
    function killed_OnKilledTarget(Unit, Event) 
    Unit:SendChatMessage(13, 0, "You fail") 
    end
    RegisterUnitEvent (60000029, 3, "killed_OnKilledTarget")
    
    function cast_spell(pUnit, event)
    pUnit:FullCastSpellOnTarget(38692, pUnit:GetRandomPlayer(0))
    end
    Atm, it dosen't work, and I know a new set of eyes can easly see the solution of the problems.

    [LUA script]
  2. #2
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to Register Events And modi npc ID

  3. #3
    TDUMm's Avatar Member
    Reputation
    1
    Join Date
    May 2008
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yh, i realy wanna learn how to do lua scripts it is great for customizing a server

  4. #4
    Snailz's Avatar Contributor Authenticator enabled
    Reputation
    239
    Join Date
    Nov 2007
    Posts
    941
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mnn I need to make a guide on how a do it...
    Cheese Cake?

  5. #5
    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)
    Really short.

    Five Gum!

  6. #6
    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)
    Kinda remade it, But here

    Code:
    function Yell_OnCombat(Unit, Event) 
    pUnit:SendChatMessage(12, 0, "We  are the Legion!")
    end
    
    function Yell_OnLeaveCombat(Unit, Event) 
    Unit:RemoveEvents() 
    pUnit:SendChatMessage(12, 0, "Hah! The legion will survive!")
    end
    
    function death_OnDied(Unit, Event) 
    Unit:RemoveEvents() 
    pUnit:SendChatMessage(12, 0, "No! When one fall, ten will come and take his place!")
    end
    
    
    function killed_OnKilledTarget(Unit, Event) 
    pUnit:SendChatMessage(13, 0, "You fail")
    end
    
    function cast_spell(pUnit, event)
    pUnit:FullCastSpellOnTarget(38692, pUnit:GetRandomPlayer(0))
    end
    
    RegisterUnitEvent (60000029, 1, "Yell_OnCombat")
    RegisterUnitEvent (60000029, 2, "Yell_OnLeaveCombat")
    RegisterUnitEvent (60000029, 4, "death_OnDied")
    RegisterUnitEvent (60000029, 3, "killed_OnKilledTarget")
    RegisterUnitEvent (60000029, , "cast_spell")
                                                    |
                                                    |- Insert Number here_
                                                                                    |
             _________________________________________/
            |
    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
    Last edited by BrantX; 05-12-2008 at 04:20 PM.



Similar Threads

  1. [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
  2. [GUIDE] How to activate LUA scripts
    By ~SaiLyn~ in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 12-25-2007, 11:52 AM
  3. Lua Scripts!
    By danis in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 12-15-2007, 03:16 PM
  4. How To LUA Script
    By Skuxta in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 12-13-2007, 04:24 AM
  5. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
All times are GMT -5. The time now is 02:05 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