[Lua] Faction Change Error menu

User Tag List

Results 1 to 4 of 4
  1. #1
    Krazymoo's Avatar Corporal
    Reputation
    1
    Join Date
    Feb 2010
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Faction Change Error

    Well, I decided to make a LUA that lets people choose what "faction" they'd like to join, out of four factions.

    But, I'm pretty sure I've got a few errors in it (as I'm realitvely new to LUA). Was wondering if anyone could have a look over it and tell me whats wrong?

    Code:
    --[[ 
    		Changing a faction for a player
    		This may or may not work. 
    		Testing
    	]]
    
    	
    -- Variables
    local NPC_ID = 50033
    
    -- On Triggers
    function GossipOnTalk(Unit, Event, player)
    	Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "Alliance", 1, 0)
    	Unit:GossipMenuAddItem(0, "Horde", 2, 0)
    	Unit:GossipMenuAddItem(0, "Scourge", 3, 0)
    	Unit:GossipMenUAddItem(0, "Worgen", 4, 0)
    	Unit:GossipMenuAddItem(0, "I'd like another faction", 500, 0)
    	Unit:GossipSendMenu(player)
    end
    
    function GossipOnTalk(Unit, Event, player, id, intid, code, pMisc)
    	if (intid == 1) then
    	Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "Male Human", 5. 0)
    	Unit:GossipMenuAddItem(0, "Female Human", 6, 0)
    	Unit:GossipMenuAddItem(0, "Male Dwarf", 7, 0)
    	Unit:GossipMenuAddItem(0, "Female Dwarf", 8, 0)
    	Unit:GossipMenuAddItem(0, "Male Gnome", 9, 0)
    	Unit:GossipMenuAddItem(0, "Female Gnome", 10, 0)
    	Unit:GossipMenuAddItem(0, "Male Night Elf", 11, 0)
    	Unit:GossipMenuAddItem(0, "Female Night Elf", 12, 0)
    	Unit:GossipMenuAddItem(0, "Male Draenei", 13, 0)
    	Unit:GossipMenuAddItem(0, "Female Draenei", 14, 0)
    	Unit:GossipMenuAdditem(0, "Male Orc", 15, 0)
    	Unit:GossipMenuAddItem(0, "Female Orc", 16, 0)
    	Unit:GossipMenuAddItem(0, "Male Undead", 17, 0)
    	Unit:GossipMenuAddItem(0, "Female Undead", 18, 0)
    	Unit:GossipMenuAddItem(0, "Male Troll", 19, 0)
    	Unit:GossipMenuAddItem(0, "Female Troll", 20, 0)
    	Unit:GossipMenuAddItem(0, "Male Tauren", 21, 0)
    	Unit:GossipMenuAddItem(0, "Female Tauren", 22, 0)
    	Unit:GossipMenuAddItem(0, "Male Blood Elf", 23, 0)
    	Unit:GossipMenuAddItem(0, "Female Blood Elf", 24, 0)
    	Unit:GossipMenuAddItem(0, "I'd like to join another faction", 500, 0)
    	Unit:GossipSendMenu(player)	
    			player:SetFaction(72)
    			player:SetPlayerAtWar(76, 1)
    			player:SetPlayerAtWar(528, 1)
    			playerSetPlayerAtWar(68, 1)
    			player:SendBroadcastMessage("Your now a member of the Alliance!")
    			
    	end
    end	
    	if (intid == 2) then
    	Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "Male Human", 25. 0)
    	Unit:GossipMenuAddItem(0, "Female Human", 26, 0)
    	Unit:GossipMenuAddItem(0, "Male Dwarf", 27, 0)
    	Unit:GossipMenuAddItem(0, "Female Dwarf", 28, 0)
    	Unit:GossipMenuAddItem(0, "Male Gnome", 29, 0)
    	Unit:GossipMenuAddItem(0, "Female Gnome", 30, 0)
    	Unit:GossipMenuAddItem(0, "Male Night Elf", 31, 0)
    	Unit:GossipMenuAddItem(0, "Female Night Elf", 32, 0)
    	Unit:GossipMenuAddItem(0, "Male Draenei", 33, 0)
    	Unit:GossipMenuAddItem(0, "Female Draenei", 34, 0)
    	Unit:GossipMenuAdditem(0, "Male Orc", 35, 0)
    	Unit:GossipMenuAddItem(0, "Female Orc", 36, 0)
    	Unit:GossipMenuAddItem(0, "Male Undead", 37, 0)
    	Unit:GossipMenuAddItem(0, "Female Undead", 38, 0)
    	Unit:GossipMenuAddItem(0, "Male Troll", 39, 0)
    	Unit:GossipMenuAddItem(0, "Female Troll", 30, 0)
    	Unit:GossipMenuAddItem(0, "Male Tauren", 41, 0)
    	Unit:GossipMenuAddItem(0, "Female Tauren", 42, 0)
    	Unit:GossipMenuAddItem(0, "Male Blood Elf", 43, 0)
    	Unit:GossipMenuAddItem(0, "Female Blood Elf", 44, 0)
    	Unit:GossipMenuAddItem(0, "I'd like to join another faction", 500, 0)
    	Unit:GossipSendMenu(player)    	
    			player:SetFaction(76)
    			player:SetPlayerAtWar(72, 1)
    			player:SetPlayerAtWar(528, 1)
    			player:SetPlayerAtWar(68, 1)
    			player:SendBroadcastMessage("Your now a member of the Horde!")
    			
    	end
    end	
    	if (intd == 3) then
    	Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "Skeletal Soldier", 45. 0)
    	Unit:GossipMenuAddItem(0, "Blighted Zombie", 46, 0)
    	Unit:GossipMenuAddItem(0, "Darkfallen Archmage (Caster)", 47, 0)
    	Unit:GossipMenuAddItem(0, "Darkfallen Blood Knight (Melee)", 48, 0)
    	Unit:GossipMenuAddItem(0, "Servant of the Throne (Caster)", 49, 0)
    	Unit:GossipMenuAddItem(0, "I'd like to join another faction", 500, 0)
    	Unit:GossipSendMenu(player)		
    			player:SetFaction(529)
    			player:SetPlayerAtWar(72, 1)
    			player:SetPlayerAtWar(76, 1)
    			player:SetPlayerAtWar(68, 1)
    			player:SendBroadcastMessage("Your now a member of the Scourge!")
    			
    	end
    end	
    	if (intid == 4) then
    	Unit:GossipCreateMenu(100, player, 0)
    	Unit:GossipMenuAddItem(0, "BLoodmoon Worgen", 50, 0)
    	Unit:GossipMenuAddItem(0, "Nightbane Worgen", 51, 0)
    	Unit:GossipMenuAddItem(0, "I'd like to join another faction", 500, 0)
    	Unit:GossipSendMenu(player)		
    			player:SetFaction(68)
    			player:SetPlayerAtWar(72, 1)
    			player:SetPlayerAtWar(76, 1)
    			player:SetPlayerAtWar(68, 1)
    			player:SendBroadcastMessage("Your now a member of the Worgen!")
    			
    	end
    end
    
    
    --[[ Changing Displays ]]--
    
    if (intid == 5) then
    	player:SetModel(49)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 6) then
    	player:SetModel(49)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 7) then
    	player:SetModel(52)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 8) then
    	player:SetModel(52)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 9) then
    	player:SetModel(1563)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 10) then
    	player:SetModel(1563)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 11) then
    	player:SetModel(55)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 12) then
    	player:SetModel(55)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 13) then
    	player:SetModel(16125)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 14) then
    	player:SetModel(16125)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 15) then
    	player:SetModel(51)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 16) then
    	player:SetModel(51)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 17) then
    	player:SetModel(57)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 18) then
    	player:SetModel(57)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 19) then
    	player:SetModel(1478)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 20) then
    	player:SetModel(1478)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 21) then
    	player:SetModel(59)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 22) then
    	player:SetModel(59)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 23) then
    	player:SetModel(15476)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 24) then
    	player:SetModel(15476)
    		Unit:Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 25) then
    	player:SetModel(49)
    		Unit:Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 26) then
    	player:SetModel(49)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 27) then
    	player:SetModel(52)
    		Unit:Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 28) then
    	player:SetModel(52)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 29) then
    	player:SetModel(1563)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 30) then
    	player:SetModel(1563)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 31) then
    	player:SetModel(55)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 32) then
    	player:SetModel(55)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 33) then
    	player:SetModel(16125)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 34) then
    	player:SetModel(16125)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 35) then
    	player:SetModel(51)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 36) then
    	player:SetModel(51)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 37) then
    	player:SetModel(57)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 38) then
    	player:SetModel(57)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 39) then
    	player:SetModel(1478)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 40) then
    	player:SetModel(1478)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 41) then
    	player:SetModel(59)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 42) then
    	player:SetModel(59)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 43) then
    	player:SetModel(15476)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 44) then
    	player:SetModel(15476)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 45) then
    	player:SetModel(30616)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end 
    
    if (intid == 46) then
    	player:SetModel(10970)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end 
    
    if (intid == 47) then
    	player:SetModel(30713)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end 
    
    if (intid == 48) then
    	player:SetModel(31025)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 49) then
    	player:SetModel(26919)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 50) then
    	player:SetModel(26787)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 51) then
    	player:SetModel(657)
    		Unit:GossipCreateMenu(100, player, 0)
    		Unit:GossipMenuAddItem(0, "I'd like another Race please.", 500, 0)
    		Unit:GossipSendMenu(player)
    		player:GossipComplete()
    end
    
    end
    
    -- RegisterUnitEvents
    RegisterUnitGossipEvent(50033, 1, "GossipOnTalk")
    RegisterUnitGossipEvent(50033, 2, "GossipOnSelect")
    Pretty sure I've got way to many "ends" in the lua.

    One error it shows is "faction.lua:23: '>' expected near '0'"

    [Lua] Faction Change Error
  2. #2
    The-Eradicator's Avatar Contributor

    Reputation
    149
    Join Date
    May 2007
    Posts
    829
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit it in Notepad++, and you'll be able to tell if you have any obvious syntax errors like too many ends.
    The most beautiful thing we can experience is the mysterious. It is the source of all true art and all science. He to whom this emotion is a stranger, who can no longer pause to wonder and stand rapt in awe, is as good as dead: his eyes are closed.
    Albert Einstein

  3. #3
    Krazymoo's Avatar Corporal
    Reputation
    1
    Join Date
    Feb 2010
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I used Notepad++ but it didn't really show anything, when I tried to load it it said "faction.lua:23:'>' expected near '0'"

  4. #4
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,503
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unit:GossipMenuAddItem(0, "Male Human", 5. 0) has a full stop after the 5 instead of a comma.

Similar Threads

  1. [Lua] Faction Change
    By Krazymoo in forum WoW EMU General Releases
    Replies: 3
    Last Post: 03-16-2010, 08:24 AM
  2. Faction change
    By noobee in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 02-09-2009, 09:49 AM
  3. [Help] LUA boss script error.
    By arthars1 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 06-09-2008, 08:23 PM
  4. Race-Race change error plz help
    By Lexan in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 02-27-2007, 10:30 AM
All times are GMT -5. The time now is 05:52 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