Problem Script menu

User Tag List

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

    Problem Script

    I modified a frequently used teleport script to include starting areas. Every time I click on the Starting Areas option that the NPC shows when I talk to it, it crashes the server. All other options work just fine and worked fine before I modified it to include starting areas. Please advise me on what's wrong with it because I've looked it over time after time and can't find the problem.
    The only thing that causes an issue is clicking "Starting Areas".

    Code:
    function On_Gossip(unit, event, player)
    unit:GossipCreateMenu(3544, player, 0)
    unit:GossipMenuAddItem(2, "Neutral Cities", 1, 0)
    unit:GossipMenuAddItem(2, "Alliance Cities", 2, 0)
    Unit:GossipMenuAddItem(2, "Starting Areas", 3, 0)
    unit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    if(intid == 999) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(2, "Neutral Cities", 1, 0)
    unit:GossipMenuAddItem(2, "Alliance Cities", 2, 0)
    Unit:GossipMenuAddItem(2, "Starting Areas", 3, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 1) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(1, "Dalaran", 300, 0)
    unit:GossipMenuAddItem(1, "Shattrath", 309, 0)
    unit:GossipMenuAddItem(0, "[Back]", 999, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 2) then
    unit:GossipCreateMenu(3543, player, 0)
    unit:GossipMenuAddItem(1, "Stormwind", 301, 0)
    unit:GossipMenuAddItem(1, "Ironforge", 302, 0)
    unit:GossipMenuAddItem(1, "Darnassus", 303, 0)
    unit:GossipMenuAddItem(1, "Exodar", 304, 0)
    unit:GossipMenuAddItem(0, "[Back]", 999, 0)
    unit:GossipSendMenu(player)
    end
    
    if(intid == 3) then
    Unit:GossipCreateMenu(3543, player, 0)
    Unit:GossipMenuAddItem(1, "Northshire Valley, Elwynn", 310)
    Unit:GossipMenuAddItem(2, "Coldridge Valley, Dun Morogh", 311)
    Unit:GossipMenuAddItem(3, "Shadowglen, Teldrassil", 312)
    Unit:GossipMenuAddItem(4, "Ammenvale, Azuremyst Isle", 313)
    Unit:GossipMenuAddItem(0, "[Back]", 999, 0)
    Unit:GossipSendMenu(player)
    end
    
    if(intid == 300) then
    player:Teleport(571, 5797.790039, 629.401978, 647.406006)
    unit:GossipComplete(player)
    end
    
    if(intid == 301) then
    player:Teleport(0, -8924.008789, 545.104614, 94.247452)
    unit:GossipComplete(player)
    end
    
    if(intid == 302) then
    player:Teleport(0, -4981.250000, -881.541992, 501.659760)
    unit:GossipComplete(player)
    end
    
    if(intid == 303) then
    player:Teleport(1, 9953.057617, 2239.959961, 1333.273438)
    unit:GossipComplete(player)
    end
    
    if(intid == 304) then
    player:Teleport(530, -4014.080078, -11895.799805, -1.990461)
    unit:GossipComplete(player)
    end
    
    if(intid == 309) then
    player:Teleport(530, -1722.579956, 5382.700195, 1.475762)
    unit:GossipComplete(player)
    end
    
    if(initid == 310) then
    player:Teleport(0, -8949.950195, -132.492996, 83.531197)
    Unit:GossipComplete(player)
    end
    
    if(intid == 311) then
    player:Teleport(0, -6240.319824, -331.032990, 382.757996)
    Unit:GossipComplete(player)
    end
    
    if(intid == 312) then
    player:Teleport(1, 10311.299805, 832.463013, 1326.407104)
    Unit:GossipComplete(player)
    end
    
    if(intid == 313) then
    player:Teleport(530, -3961.639893, -13931.200195, 100.613510)
    Unit:GossipComplete(player)
    end
    end
    
    RegisterUnitGossipEvent(87656, 1, "On_Gossip")
    RegisterUnitGossipEvent(87656, 2, "Gossip_Submenus")
    Thanks!

    Problem Script
  2. #2
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Capital U on unit:

    If I remember correctly you need to have either all caps or all lower case.

  3. #3
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    function On_Gossip(unit, event, player)

    You define unit without a capital in the parameters here.

    But here:

    Unit:GossipMenuAddItem(2, "Starting Areas", 3, 0)

    You instead use a capital U. Hence the error.

    You do this throughout the script.

  4. #4
    Talrain's Avatar Member
    Reputation
    2
    Join Date
    Oct 2008
    Posts
    75
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doh. Thanks.

  5. #5
    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)
    Lua is case sensitive and code sensitive. (ex in your situation: if you register in Function 'unit', it cant be in code 'Unit:' )


  6. #6
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Trle94 View Post
    Lua is case sensitive and code sensitive. (ex in your situation: if you register in Function 'unit', it cant be in code 'Unit:' )
    Pretty sure harry just said that above you.

Similar Threads

  1. [Help] Fairly large Lua script problem
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 03-16-2008, 09:03 PM
  2. LUA Scripting Problem
    By Knife in forum World of Warcraft Emulator Servers
    Replies: 18
    Last Post: 03-10-2008, 02:00 PM
  3. Problems with my C++ script
    By Sylex in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 02-07-2008, 08:04 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 Boss Script Problems!!
    By blah7 in forum World of Warcraft Emulator Servers
    Replies: 14
    Last Post: 01-22-2008, 08:59 PM
All times are GMT -5. The time now is 02:48 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