[Help] Error in LUA teleport file menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Mildan's Avatar Member
    Reputation
    10
    Join Date
    Feb 2009
    Posts
    80
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] Error in LUA teleport file

    Code:
    EntryID = 123454
    
    function Test_OnGossip(pUnit, Event, Player)
    	pUnit:GossipCreateMenu(3544, player)
    	pUnit:GossipMenuAddItem(2, "Alliance Leaders", 1)
    	pUnit:GossipMenuAddItem(2, "Horde Leaders", 2)
    	pUnit:GossipSendMenu(Player)
    end
    
    function Gossip_Submenus(pUnit, Event, Player, Id, Intid, Code)
    if(intid == 999) then
    	pUnit:GossipCreateMenu(3543, player)
    	pUnit:GossipMenuAddItem(2, "Alliance Leaders", 1)
    	pUnit:GossipMenuAddItem(2, "Horde Leaders", 2)
    	pUnit:GossipSendMenu(Player)
    end
    
    if(intid == 1) then
    	if pUnit:PlayerRace() == 2, 5, 6, 8, 10, then
    	pUnit:GossipCreateMenu(3543, player)
    	pUnit:GossipMenuAddItem(1, "King Varian Wrynn", 3)
    	pUnit:GossipMenuAddItem(1, "King Magni Bronzebeard", 4)
    	pUnit:GossipMenuAddItem(1, "Tyrande Whisperwind", 5)
    	pUnit:GossipMenuAddItem(1, "Prophet Velen", 6)
    	pUnit:GossipMenuAddItem(0, "[Back]", 999)
    	pUnit:GossipSendMenu(Player)
    	else
    	player:SendBroadcastMessage("You are alliance.")
    	pUnit:GossipComplete(player)
    end
    end
    
    if(intid == 2) then
    	if pUnit:PlayerRace() == 1, 3, 4, 7, 11, then
    	pUnit:GossipCreateMenu(3543, player)
    	pUnit:GossipMenuAddItem(1, "Thrall", 7)
    	pUnit:GossipMenuAddItem(1, "Lady Sylvanas Windrunner", 8)
    	pUnit:GossipMenuAddItem(1, "Cairne Bloodhoof", 9)
    	pUnit:GossipMenuAddItem(1, "Lor'themar Theron", 10)
    	pUnit:GossipMenuAddItem(0, "[Back]", 999)
    	pUnit:GossipSendMenu(Player)
    	else
    	player:SendBroadcastMessage("You are horde.")
    	pUnit:GossipComplete(player)
    end
    end
    
    if(intid == 3) then
    	player:Teleport(0, -8455.885742, 351.462982, 120.843277)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 4) then
    	player:Teleport(0, -4847.004395, 1045.885254, 502.188232)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 5) then
    	player:Teleport(1, 9662.51931, 2524.570068, 1260.180054)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 6) then
    	player:Teleport(530, -4023.633301, -11388.284180, -129.503525)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 7) then
    	player:Teleport(1, 1922.766848, 4170.967285, 40.902546)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 8) then
    	player:Teleport(0, 1290.410034, 316.247009, -54.237598)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 9) then
    	player:Teleport(1, -1209.640015, -112.697998, 163.981995)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 10) then
    	player:Teleport(530, 9965.837891, -7084.757324, 47.708710)
    	pUnit:GossipComplete(player)
    end
    
    RegisterUnitGossipEvent(EntryID, 1, "Test_OnGossip")
    RegisterUnitGossipEvent(EntryID, 2, "Gossip_Submenus")
    I get this error "Then expected at ','" and I just cant find where that is...

    [Help] Error in LUA teleport file
  2. #2
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's your error:
    if pUnit:PlayerRace() == 1, 3, 4, 7, 11, then



    There's a number of other errors, though...
    Here's a cleaned up version:
    Code:
    EntryID = 123454
    
    function Test_OnGossip(pUnit, Event, player)
    	pUnit:GossipCreateMenu(3544, player)
    	pUnit:GossipMenuAddItem(2, "Alliance Leaders", 1)
    	pUnit:GossipMenuAddItem(2, "Horde Leaders", 2)
    	pUnit:GossipSendMenu(player)
    end
    
    function Gossip_Submenus(pUnit, Event, player, Id, Intid, Code)
    if(intid == 999) then Test_OnGossip(pUnit, 0, player); end
    
    if(intid == 1) then
    	check = 0;
    	races = [2, 5, 6, 8, 10];
    	for a in races do if player:PlayerRace()==a then check = 1; end end
    	if check==1 then
    	pUnit:GossipCreateMenu(3543, player)
    	pUnit:GossipMenuAddItem(1, "King Varian Wrynn", 3)
    	pUnit:GossipMenuAddItem(1, "King Magni Bronzebeard", 4)
    	pUnit:GossipMenuAddItem(1, "Tyrande Whisperwind", 5)
    	pUnit:GossipMenuAddItem(1, "Prophet Velen", 6)
    	pUnit:GossipMenuAddItem(0, "[Back]", 999)
    	pUnit:GossipSendMenu(player)
    	else
    	player:SendBroadcastMessage("You are alliance.")
    	pUnit:GossipComplete(player)
    	end
    end
    
    if(intid == 2) then
    	check = 0;
    	races = [1, 3, 4, 7, 11];
    	for a in races do if player:PlayerRace()==a then check = 1; end end
    	if check==1 then
    	pUnit:GossipCreateMenu(3543, player)
    	pUnit:GossipMenuAddItem(1, "Thrall", 7)
    	pUnit:GossipMenuAddItem(1, "Lady Sylvanas Windrunner", 8)
    	pUnit:GossipMenuAddItem(1, "Cairne Bloodhoof", 9)
    	pUnit:GossipMenuAddItem(1, "Lor'themar Theron", 10)
    	pUnit:GossipMenuAddItem(0, "[Back]", 999)
    	pUnit:GossipSendMenu(player)
    	else
    	player:SendBroadcastMessage("You are horde.")
    	pUnit:GossipComplete(player)
    	end
    end
    
    if(intid == 3) then
    	player:Teleport(0, -8455.885742, 351.462982, 120.843277)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 4) then
    	player:Teleport(0, -4847.004395, 1045.885254, 502.188232)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 5) then
    	player:Teleport(1, 9662.51931, 2524.570068, 1260.180054)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 6) then
    	player:Teleport(530, -4023.633301, -11388.284180, -129.503525)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 7) then
    	player:Teleport(1, 1922.766848, 4170.967285, 40.902546)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 8) then
    	player:Teleport(0, 1290.410034, 316.247009, -54.237598)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 9) then
    	player:Teleport(1, -1209.640015, -112.697998, 163.981995)
    	pUnit:GossipComplete(player)
    end
    
    if(intid == 10) then
    	player:Teleport(530, 9965.837891, -7084.757324, 47.708710)
    	pUnit:GossipComplete(player)
    end
    end
    
    RegisterUnitGossipEvent(EntryID, 1, "Test_OnGossip")
    RegisterUnitGossipEvent(EntryID, 2, "Gossip_Submenus")
    Tell me if you still get any errors.

Similar Threads

  1. i need help with a LUA teleport item and buff item...
    By trujillo in forum WoW EMU Questions & Requests
    Replies: 17
    Last Post: 09-16-2009, 02:05 AM
  2. [help] Lua Teleporter Error!!
    By Hyldran0 in forum WoW EMU Questions & Requests
    Replies: 11
    Last Post: 12-16-2008, 01:06 PM
  3. +Rep for Help with Universal Lua Teleporter
    By Lytle69 in forum WoW EMU Questions & Requests
    Replies: 16
    Last Post: 12-12-2008, 07:30 AM
  4. Help with lua teleporter
    By Arugos in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 09-17-2008, 09:09 AM
  5. [Help] Error whilst compiling LUA++
    By Entr0py in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 06-10-2008, 02:48 AM
All times are GMT -5. The time now is 03:57 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