Learning LUA, Error problem menu

User Tag List

Results 1 to 6 of 6
  1. #1
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Learning LUA, Error problem

    Hey,

    I'm trying to learn LUA by starting at the easiest tut ant script I could find to learn. I typed in everything, saved it as LUA, put it in the scripts folder, made the npc, and tested the script.
    But I keep getting the same error:

    scripts\Orcgrunt_Attack.lua:2: calling 'SendChatMessage' on bad self <number expected, got nill>

    Here's my script and the tutorial I was following:

    Code:
    function Orcgrunt_Entercombat (pUnit, Event)
    pUnit:SendChatMessage(SAY, ORCISH, "Taste my blade!")
    end
    RegisterUnitEvent (500010, 1, "Orcgrunt_Entercombat")
    Forums: [LUA] Basic LUA | WoW-V.com

    Learning LUA, Error problem
  2. #2
    Trle94's Avatar Contributor
    Reputation
    167
    Join Date
    May 2009
    Posts
    329
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:
    Code:
    function Orcgrunt_EnterCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 1, "Taste my blade!")
    end
    RegisterUnitEvent(500010, 1, "Orcgrunt_Entercombat")
    Fixed mine it should work now
    Last edited by Trle94; 08-14-2010 at 12:09 PM.


  3. #3
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok just fixed the first error by fixing a capitol letter. There's now another error:
    scripts\Orcgrunt_Attack.lua:2: bad argument #1 to 'SendChatMessage' <number expected, got nill>
    Last edited by tyeeeee1; 08-14-2010 at 12:07 PM.

  4. #4
    Trle94's Avatar Contributor
    Reputation
    167
    Join Date
    May 2009
    Posts
    329
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edited my first post try now..


  5. #5
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^.^ thx it works just like I wanted it to now.
    + rep

    Also do you know where I can find a list of what numbers mean say, yell, etc... and a list of language numbers?

  6. #6
    Trle94's Avatar Contributor
    Reputation
    167
    Join Date
    May 2009
    Posts
    329
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in this your post?? - Forums: [LUA] Basic LUA | WoW-V.com


Similar Threads

  1. [Share] Learn Lua ( Not for lazy people )
    By Tom_2001 in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 02-21-2008, 03:28 PM
  2. 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
  3. [Errorz] A Lua Error I Havent seen before
    By Snailz in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 02-14-2008, 10:12 AM
  4. Lua scripts problem
    By Mr.Ice.Cold in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-02-2008, 11:44 AM
  5. .Lua portal problem
    By Kiev in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 01-12-2008, 10:49 AM
All times are GMT -5. The time now is 02:12 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