Lua Scirpt: something wrong need help menu

User Tag List

Results 1 to 4 of 4
  1. #1
    Jonthe838's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2008
    Posts
    373
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua Scirpt: something wrong need help

    Can some1 take a look at this script? i dont know whats wrong but when i click on the npc he only says "Hi, <name> how can I help you?"
    thx for helping me ^^
    Code:
    function NPC_main_menu(unit, player)
    	unit:GossipCreateMenu(50, player)
    	unit:GossipMenuAddItem(1, "The Race", 4003, extra)
    	unit:GossipSendMenu(player)
    end
    
    function NPC_on_gossip_talk(unit, event, player)
    	NPC_main_menu(unit, player)
    end
    
    function NPC_on_gossip_select(unit, event, player, id, intid, code)
    	if(intid == 4003) then
    		unit:GossipCreateMenu(61, player, 0)
    		unit:GossipMenuAddItem(1, "Teleport Me to the Racetrack", 4000, 0)
    		unit:GossipMenuAddItem(1, "Give me a Horde Bike", 4002, 0)
    		unit:GossipMenuAddItem(1, "Give me a Alliance Bike", 4001, 0)
    		unit:GossipMenuAddItem(0, "[Go Back]",  50, 0)		
    		player:GossipComplete()
    	end
    	if(code == 4002) then
    		unit:FullCastSpellOnTarget(55531, player)
    		unit:SetMovementType(0, player)
    		unit:ModifyWalkSpeed (20, player)
    		unit:GossipMenuAddItem(0, "[Go Back]",  50, 0)
    		player:GossipComplete()
    	end
    	if(code == 4001) then
    		unit:FullCastSpellOnTarget(60424, player)
    		unit:SetMovementType(0, player)
    		unit:ModifyWalkSpeed (20, player)
    		unit:GossipMenuAddItem(0, "[Go Back]",  50, 0)
    	end
    	if(code == 4000) then 
    		player:Teleport(1, 5232, -1489, 1356)
    		player:GossipComplete()
    	end
    end
    
    RegisterGossipEvent(111023, 1, "NPC_on_gossip_talk")
    RegisterGossipEvent(111023, 2, "NPC_on_gossip_select")
    Lines of Coding: |||||||||| Goal 1000
    Current: 677 Achived Goals: 500 Lines


    Lua Scirpt: something wrong need help
  2. #2
    latruwski's Avatar Banned
    Reputation
    647
    Join Date
    Dec 2006
    Posts
    2,456
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    first of all are you sure you have the needed LUA engine?
    (too tired to check script now, gonna check tomorow)

  3. #3
    Aznex's Avatar Contributor
    Reputation
    128
    Join Date
    Feb 2008
    Posts
    770
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
     function NPC_main_menu(unit, player)
    	unit:GossipCreateMenu(50, player)
    	unit:GossipMenuAddItem(1, "The Race", 4003, extra)
    	unit:GossipSendMenu(player)
    end
    
    function NPC_on_gossip_talk(unit, event, player)
    	NPC_main_menu(unit, player)
    end
    Why the hell do something like that?

    just write it directly as NPC_On_Gossip_talk. Also make sure u set the flag of the NPC to gossip in your database(its flag 1)

  4. #4
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to add the gossip flags to your NPC.

    And next time post in the Emulator Questions section .

Similar Threads

  1. Simple Lua Script , not working need help!
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 12-30-2007, 02:06 PM
  2. Need help figuring something out
    By Conflag in forum Community Chat
    Replies: 7
    Last Post: 10-12-2007, 03:17 AM
  3. will somebody do something need help!
    By sonic in forum World of Warcraft General
    Replies: 3
    Last Post: 03-04-2007, 05:02 PM
  4. need help with something
    By Shmitts in forum Community Chat
    Replies: 0
    Last Post: 11-18-2006, 04:27 PM
All times are GMT -5. The time now is 05:21 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