I'm starting todo some LUA coding but it ain't really working.. need some help guys menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I'm starting todo some LUA coding but it ain't really working.. need some help guys

    Well.. i want to begin with simple scripts.

    So i decided to make a script that makes an NPC with a specific ID say something when entering combat.

    This is what turned out:


    Code:
    function voidsay_OnCombat(Unit, Event) 
    Unit:SendChatMessage(11, 0, "LUA test")
    end
    RegisterUnitEvent(90902, 1, "voidsay_OnCombat")

    Yet.. it doesn't work.

    What did i do wrong ?

    I'm starting todo some LUA coding but it ain't really working.. need some help guys
  2. #2
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uh sorry.
    But i just found out :P i put a space between end and the registerevent and changed 11 to 12.

  3. #3
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now i'm trying to make him cast a spell.. and that made him not say "LUAtest" when entering combat..

    heres the script:


    Code:
     function voidsay_OnCombat(Unit, Event) 
    Unit:SendChatMessage(12, 0, "LUA test")
    end
    
    function voidsay_Shadow Bolt(pUnit, Event) 
    pUnit:CastSpell(16784, pUnit:GetMainTank()) 
    end
    
    RegisterUnitEvent(90902, 1, "voidsay_OnCombat")
    Unit:RegisterEvent("voidsay_Shadow Bolt", 1000, 2)

  4. #4
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got him to say LUAtest while having that script in there.
    I changed the name of the spell function.

    But he isn't casting the spell.
    Whats wrong ?

  5. #5
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dont switch between Unit or pUnit Use one or the other. and if you want him to say something other than Luatest.. Replace the text where it says Lua test with what you want him to say

    Code:
    function Voidsay_OnCombat (pUnit, event)
             pUnit:SendChatMessage(14, 0, "LUATEST!")
             pUnit:RegisterEvent("Voidsay_ShadowBolt", 1000, 1)
    end
    
    function voidsay_ShadowBolt(pUnit, Event) 
    pUnit:CastSpell(16784, pUnit:GetMainTank()) 
    end
    
    RegisterUnitEvent(90902, 1, "Voidsay_OnCombat")

    Try that just looked at it quick so might have missed something...

    Also dont use SPACES when giving your functions names it should be SHADOWBOLT not SHADOW BOLT
    Last edited by kreegoth; 01-06-2009 at 02:40 PM.

  6. #6
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah i understand a bit better now. I'll see if it works. Thanks.

  7. #7
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He doesn't cast the spell. =/

  8. #8
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The console said:
    "Tried to call LUA function "voidsay_shadowbolt" from Arcemu <unit>!"

  9. #9
    Gosko's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    53
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try to capitalize the v

    Code:
    function Voidsay_ShadowBolt(pUnit, Event)

Similar Threads

  1. [Lua]Boss phases not working, NEED PRO HELP!!
    By blah7 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 01-23-2008, 02:30 PM
  2. need some help guys(scammed)
    By Tubz in forum Community Chat
    Replies: 7
    Last Post: 07-11-2007, 06:09 AM
All times are GMT -5. The time now is 05:40 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