[LUA] GuaEngine Script menu

User Tag List

Results 1 to 6 of 6
  1. #1
    LJN's Avatar Member
    Reputation
    273
    Join Date
    Jun 2007
    Posts
    731
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] GuaEngine Script

    I have a problem with the GuaEngine or the script I'm not sure. My script "War Tele" Loads fine with no problems, but when I go speek with the NPC in the console I get this message:
    Code:
    scripts\War Tele.lua:7: attempt to call method `IsHorde` <a nil value>
    Then here is the script:
    Code:
    function A_OnGossipTalk(pUnit, event, player, pMisc)
       if (player:IsInCombat() == true) then
       player:SendAreaTriggerMessage("Please leave combat first.")
       player:SendBroadcastMessage("Please leave combat first.")
       pUnit:GossipComplete(player)
       else
    	 if player:IsHorde() == true then
       	 pUnit:GossipCreateMenu(44484, player, 0)
             pUnit:GossipMenuAddItem(0, "Hillsbrad", 1, 0)
             pUnit:GossipMenuAddItem(0, "Ambermill", 2, 0)
             pUnit:GossipMenuAddItem(0, "Pyrewood Village", 3, 0)
             pUnit:GossipMenuAddItem(0, "The Sepulcher", 4, 0)
             pUnit:GossipMenuAddItem(0, "Brill", 5, 0)
             pUnit:GossipMenuAddItem(0, "Deathknell", 6, 0)
             pUnit:GossipMenuAddItem(0, "Agamand Mills", 7, 0)
             pUnit:GossipMenuAddItem(0, "Scarlet Watch Post", 8, 0)
             pUnit:GossipMenuAddItem(0, "Fenris Keep", 9, 0)
             pUnit:GossipMenuAddItem(0, "Lordamere Internment Camp", 10, 0)
             pUnit:GossipMenuAddItem(0, "Witherbark Village", 11, 0)
             pUnit:GossipMenuAddItem(0, "Undercity", 12, 0)
      	 pUnit:GossipSendMenu(player)
    	 else
       	 pUnit:GossipCreateMenu(44485, player, 0)
      	 pUnit:GossipMenuAddItem(0, "Scarlet Monastery", 13, 0)
     	 pUnit:GossipMenuAddItem(0, "Dandred's Fold", 14, 0)
             pUnit:GossipMenuAddItem(0, "Strahnbrad", 15, 0)
             pUnit:GossipMenuAddItem(0, "Tarren Mill", 16, 0)
             pUnit:GossipMenuAddItem(0, "Southshore", 17, 0)
             pUnit:GossipMenuAddItem(0, "Azurelode Mine", 18, 0)
             pUnit:GossipMenuAddItem(0, "Dun Garok", 19, 0)
             pUnit:GossipMenuAddItem(0, "Northfold Manor", 20, 0)
             pUnit:GossipMenuAddItem(0, "Refuge Pointe", 21, 0)
             pUnit:GossipMenuAddItem(0, "Go'Shek Farm", 22, 0)
             pUnit:GossipMenuAddItem(0, "Hammerfall", 23, 0)
             pUnit:GossipMenuAddItem(0, "Stromgarde Keep", 24, 0)
      	 pUnit:GossipSendMenu(player)
    	 end
       end
    end
    
    function A_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
        if (intid == 1) then -- Hillsbrad
        player:Teleport(0,-512.895,120.608,59.059)
        player:GossipComplete()
        end
        if (intid == 2) then -- Ambermill
        player:Teleport(0,-114.954,790.748,66.0243)
        player:GossipComplete()
        end
        if (intid == 3) then -- Pyrewood Village
        player:Teleport(0,-397.223,1494.03,19.7709)   
        player:GossipComplete()
        end
        if (intid == 4) then -- The Sepulcher
        player:Teleport(0,508.323,1626.5,125.67)   
        player:GossipComplete()
        end
        if (intid == 5) then -- Brill
        player:Teleport(0,2315.38,288.395,37.3115)   
        player:GossipComplete()
        end
        if (intid == 6) then -- Deathknell   
        player:Teleport(0,1900.96,1504.57,89.1851)
        player:GossipComplete()
        end
        if (intid == 7) then -- Agamand Mills   
        player:Teleport(0,2806.27,837.62,111.839)
        player:GossipComplete()
        end
        if (intid == 8) then -- Scarlet Watch Post   
        player:Teleport(0,3075.05,-557.875,126.719)
        player:GossipComplete()
        end
        if (intid == 9) then -- Fenris Keep   
        player:Teleport(0,952.741,688.821,59.7365)
        player:GossipComplete()
        end
        if (intid == 10) then -- Lordamere Internment Camp   
        player:Teleport(0,-111.501,219.243,55.4719)
        player:GossipComplete()
        end
        if (intid == 11) then -- Witherbark Village   
        player:Teleport(0,-1740.75,-3306.2,31.933)
        player:GossipComplete()
        end
        if (intid == 12) then -- Undercity   
        player:Teleport(0,1804.57,196.747,70.3997)
        player:GossipComplete()
        end
        if (intid == 13) then -- Scarlet Monastery   
        player:Teleport(0,2842.9,-692.041,139.331)
        player:GossipComplete()
        end
        if (intid == 14) then -- Dandred's Fold   
        player:Teleport(0,1217.38,-319.887,43.6272)
        player:GossipComplete()
        end
        if (intid == 15) then -- Strahnbrad   
        player:Teleport(0,725.348,-960.463,166.227)
        player:GossipComplete()
        end
        if (intid == 16) then -- Tarren Mill   
        player:Teleport(0,-43.7803,-959.331,56.1964)
        player:GossipComplete()
        end
        if (intid == 17) then -- Southshore   
        player:Teleport(0,-855.023,-568.114,11.065)
        player:GossipComplete()
        end
        if (intid == 18) then -- Azurelode Mine   
        player:Teleport(0,-892.006,214.846,9.01674)
        player:GossipComplete()
        end
        if (intid == 19) then -- Dun Garok   
        player:Teleport(0,-1275.26,-1205.06,40.1765)
        player:GossipComplete()
        end
        if (intid == 20) then -- Northfold Manor   
        player:Teleport(0,-852.653,-2065.54,33.9942)
        player:GossipComplete()
        end
        if (intid == 21) then -- Refuge Pointe   
        player:Teleport(0,-1233.74,-2518.68,21.7386)
        player:GossipComplete()
        end
        if (intid == 22) then -- Go'Shek Farm   
        player:Teleport(0,-1495.79,-3057.41,13.8505)
        player:GossipComplete()
        end
        if (intid == 23) then -- Hammerfall   
        player:Teleport(0,-945.063,-3536.31,70.9339)
        player:GossipComplete()
        end
        if (intid == 24) then -- Stromgarde Keep   
        player:Teleport(0,-1648.33,-1802.53,79.9609)
        player:GossipComplete()
        end
    end
    
    RegisterUnitGossipEvent(8, 1, "A_OnGossipTalk")
    RegisterUnitGossipEvent(8, 2, "A_OnGossipSelect")
    Last edited by LJN; 07-15-2009 at 11:32 PM.
    ahhhh

    [LUA] GuaEngine Script
  2. #2
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I shall talk to you on msn.

    I live in a shoe

  3. #3
    Confucius's Avatar Super Moderator Don't Look Back in Anger

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1418
    Join Date
    Oct 2007
    Posts
    2,805
    Thanks G/R
    301/311
    Trade Feedback
    7 (100%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    [code]if player:IsHorde() == true then
    pUnit:GossipCreateMenu(44484, player, 0)
    pUnit:GossipMenuAddItem(0, "Hillsbrad", 1, 0)
    pUnit:GossipMenuAddItem(0, "Ambermill", 2, 0)
    pUnit:GossipMenuAddItem(0, "Pyrewood Village", 3, 0)
    pUnit:GossipMenuAddItem(0, "The Sepulcher", 4, 0)
    pUnit:GossipMenuAddItem(0, "Brill", 5, 0)
    pUnit:GossipMenuAddItem(0, "Deathknell", 6, 0)
    pUnit:GossipMenuAddItem(0, "Agamand Mills", 7, 0)
    pUnit:GossipMenuAddItem(0, "Scarlet Watch Post", 8, 0)
    pUnit:GossipMenuAddItem(0, "Fenris Keep", 9, 0)
    pUnit:GossipMenuAddItem(0, "Lordamere Internment Camp", 10, 0)
    pUnit:GossipMenuAddItem(0, "Witherbark Village", 11, 0)
    pUnit:GossipMenuAddItem(0, "Undercity", 12, 0)
    pUnit:GossipSendMenu(player)
    else
    pUnit:GossipCreateMenu(44485, player, 0) <----- is same number as above (44485, try changing it to 44486 or something, I had same problem with my script until I changed it)
    pUnit:GossipMenuAddItem(0, "Scarlet Monastery", 13, 0)
    pUnit:GossipMenuAddItem(0, "Dandred's Fold", 14, 0)
    pUnit:GossipMenuAddItem(0, "Strahnbrad", 15, 0)
    pUnit:GossipMenuAddItem(0, "Tarren Mill", 16, 0)
    pUnit:GossipMenuAddItem(0, "Southshore", 17, 0)
    pUnit:GossipMenuAddItem(0, "Azurelode Mine", 18, 0)
    pUnit:GossipMenuAddItem(0, "Dun Garok", 19, 0)
    pUnit:GossipMenuAddItem(0, "Northfold Manor", 20, 0)
    pUnit:GossipMenuAddItem(0, "Refuge Pointe", 21, 0)
    pUnit:GossipMenuAddItem(0, "Go'Shek Farm", 22, 0)
    pUnit:GossipMenuAddItem(0, "Hammerfall", 23, 0)
    pUnit:GossipMenuAddItem(0, "Stromgarde Keep", 24, 0)
    pUnit:GossipSendMenu(player)
    end
    end

  4. #4
    LJN's Avatar Member
    Reputation
    273
    Join Date
    Jun 2007
    Posts
    731
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I still get the same problem.
    ahhhh

  5. #5
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    seems that the IsHorde() Boolean didnt work...you can try it with 'local race=player:GetPlayerRace()' and checking the race:

    Code:
    function A_OnGossipTalk(pUnit, event, player, pMisc)
       if (player:IsInCombat() == true) then
       player:SendAreaTriggerMessage("Please leave combat first.")
       player:SendBroadcastMessage("Please leave combat first.")
       pUnit:GossipComplete(player)
       else
         local race=player:GetPlayerRace()
            if race==2 or race==5 or race==6 or race==8 or race==10 then
       	  pUnit:GossipCreateMenu(44484, player, 0)
              pUnit:GossipMenuAddItem(0, "Hillsbrad", 1, 0)
              pUnit:GossipMenuAddItem(0, "Ambermill", 2, 0)
              pUnit:GossipMenuAddItem(0, "Pyrewood Village", 3, 0)
              pUnit:GossipMenuAddItem(0, "The Sepulcher", 4, 0)
              pUnit:GossipMenuAddItem(0, "Brill", 5, 0)
              pUnit:GossipMenuAddItem(0, "Deathknell", 6, 0)
              pUnit:GossipMenuAddItem(0, "Agamand Mills", 7, 0)
              pUnit:GossipMenuAddItem(0, "Scarlet Watch Post", 8, 0)
              pUnit:GossipMenuAddItem(0, "Fenris Keep", 9, 0)
              pUnit:GossipMenuAddItem(0, "Lordamere Internment Camp", 10, 0)
              pUnit:GossipMenuAddItem(0, "Witherbark Village", 11, 0)
              pUnit:GossipMenuAddItem(0, "Undercity", 12, 0)
      	  pUnit:GossipSendMenu(player)
           else
             if race==1 or race==3 or race==4 or race==7 or race==11 then
        	  pUnit:GossipCreateMenu(44485, player, 0)
      	  pUnit:GossipMenuAddItem(0, "Scarlet Monastery", 13, 0)
     	  pUnit:GossipMenuAddItem(0, "Dandred's Fold", 14, 0)
              pUnit:GossipMenuAddItem(0, "Strahnbrad", 15, 0)
              pUnit:GossipMenuAddItem(0, "Tarren Mill", 16, 0)
              pUnit:GossipMenuAddItem(0, "Southshore", 17, 0)
              pUnit:GossipMenuAddItem(0, "Azurelode Mine", 18, 0)
              pUnit:GossipMenuAddItem(0, "Dun Garok", 19, 0)
              pUnit:GossipMenuAddItem(0, "Northfold Manor", 20, 0)
              pUnit:GossipMenuAddItem(0, "Refuge Pointe", 21, 0)
              pUnit:GossipMenuAddItem(0, "Go'Shek Farm", 22, 0)
              pUnit:GossipMenuAddItem(0, "Hammerfall", 23, 0)
              pUnit:GossipMenuAddItem(0, "Stromgarde Keep", 24, 0)
              pUnit:GossipSendMenu(player)
    	 end
            end
       end
    end
    
    function A_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
        if (intid == 1) then -- Hillsbrad
        player:Teleport(0,-512.895,120.608,59.059)
        player:GossipComplete()
        end
        if (intid == 2) then -- Ambermill
        player:Teleport(0,-114.954,790.748,66.0243)
        player:GossipComplete()
        end
        if (intid == 3) then -- Pyrewood Village
        player:Teleport(0,-397.223,1494.03,19.7709)   
        player:GossipComplete()
        end
        if (intid == 4) then -- The Sepulcher
        player:Teleport(0,508.323,1626.5,125.67)   
        player:GossipComplete()
        end
        if (intid == 5) then -- Brill
        player:Teleport(0,2315.38,288.395,37.3115)   
        player:GossipComplete()
        end
        if (intid == 6) then -- Deathknell   
        player:Teleport(0,1900.96,1504.57,89.1851)
        player:GossipComplete()
        end
        if (intid == 7) then -- Agamand Mills   
        player:Teleport(0,2806.27,837.62,111.839)
        player:GossipComplete()
        end
        if (intid == 8) then -- Scarlet Watch Post   
        player:Teleport(0,3075.05,-557.875,126.719)
        player:GossipComplete()
        end
        if (intid == 9) then -- Fenris Keep   
        player:Teleport(0,952.741,688.821,59.7365)
        player:GossipComplete()
        end
        if (intid == 10) then -- Lordamere Internment Camp   
        player:Teleport(0,-111.501,219.243,55.4719)
        player:GossipComplete()
        end
        if (intid == 11) then -- Witherbark Village   
        player:Teleport(0,-1740.75,-3306.2,31.933)
        player:GossipComplete()
        end
        if (intid == 12) then -- Undercity   
        player:Teleport(0,1804.57,196.747,70.3997)
        player:GossipComplete()
        end
        if (intid == 13) then -- Scarlet Monastery   
        player:Teleport(0,2842.9,-692.041,139.331)
        player:GossipComplete()
        end
        if (intid == 14) then -- Dandred's Fold   
        player:Teleport(0,1217.38,-319.887,43.6272)
        player:GossipComplete()
        end
        if (intid == 15) then -- Strahnbrad   
        player:Teleport(0,725.348,-960.463,166.227)
        player:GossipComplete()
        end
        if (intid == 16) then -- Tarren Mill   
        player:Teleport(0,-43.7803,-959.331,56.1964)
        player:GossipComplete()
        end
        if (intid == 17) then -- Southshore   
        player:Teleport(0,-855.023,-568.114,11.065)
        player:GossipComplete()
        end
        if (intid == 18) then -- Azurelode Mine   
        player:Teleport(0,-892.006,214.846,9.01674)
        player:GossipComplete()
        end
        if (intid == 19) then -- Dun Garok   
        player:Teleport(0,-1275.26,-1205.06,40.1765)
        player:GossipComplete()
        end
        if (intid == 20) then -- Northfold Manor   
        player:Teleport(0,-852.653,-2065.54,33.9942)
        player:GossipComplete()
        end
        if (intid == 21) then -- Refuge Pointe   
        player:Teleport(0,-1233.74,-2518.68,21.7386)
        player:GossipComplete()
        end
        if (intid == 22) then -- Go'Shek Farm   
        player:Teleport(0,-1495.79,-3057.41,13.8505)
        player:GossipComplete()
        end
        if (intid == 23) then -- Hammerfall   
        player:Teleport(0,-945.063,-3536.31,70.9339)
        player:GossipComplete()
        end
        if (intid == 24) then -- Stromgarde Keep   
        player:Teleport(0,-1648.33,-1802.53,79.9609)
        player:GossipComplete()
        end
    end
    
    RegisterUnitGossipEvent(8, 1, "A_OnGossipTalk")
    RegisterUnitGossipEvent(8, 2, "A_OnGossipSelect")
    This should work.
    Last edited by Kaidos; 07-16-2009 at 05:14 AM.

  6. #6
    LJN's Avatar Member
    Reputation
    273
    Join Date
    Jun 2007
    Posts
    731
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help +Repx4
    ahhhh

Similar Threads

  1. [HELP] Lua boss script not working-solutions?
    By WinKIller0 in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 03-21-2008, 08:19 AM
  2. LUA Boss Script
    By Lindoz12 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 03-04-2008, 02:45 PM
  3. LUA Boss Script Help
    By neurothymia in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 02-05-2008, 02:57 PM
  4. Lua Boss Script Problems!!
    By blah7 in forum World of Warcraft Emulator Servers
    Replies: 14
    Last Post: 01-22-2008, 08:59 PM
  5. Lua Ascent Script Documentation
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 11-26-2007, 12:42 PM
All times are GMT -5. The time now is 11:13 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