[Lua] Help with Gossip? menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Beasthuntah's Avatar Member
    Reputation
    1
    Join Date
    Jul 2008
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Help with Gossip?

    Hello I have a problem with this piece of lua script.. it should cast a protective shield on the player, but instead it casts it on the unit itself..
    Code:
    function Crystal_OnGossipTalk(Antza, Event, Player)
    	Antza:GossipCreateMenu(300, Player , 0)
    	Antza:GossipMenuAddItem(0, "Use the power of the Crystal to protect yourself from explosions.", 0, 0)
    	Antza:GossipSendMenu(Player)
    end
    
    function Crystal_OnGossipSelect(Antza, Event, Player, Id, Intid, Code)
    	if (Intid == 0) then
    	Antza:FullCastSpellOnTarget(37538, Player)
    	Player:GossipComplete()
    end
    end
    
    	RegisterUnitGossipEvent(856675, 1, "Crystal_OnGossipTalk")
    	RegisterUnitGossipEvent(856675, 2, "Crystal_OnGossipSelect")
    As you can see I replaced pUnit/Unit with Antza, as it does work too and it makes the script more "personal".. So there's no really difference between pUnit and Unit I guess..

    [Lua] Help with Gossip?
  2. #2
    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)
    try:

    Code:
    if (Intid == 0) then
    local Target = Antza:GetTarget()
    Antza:FullCastSpellOnTarget(37538, Target)

    or something.

    The trick with Lua is to play around with it till it works, try different spells etc.

  3. #3
    Beasthuntah's Avatar Member
    Reputation
    1
    Join Date
    Jul 2008
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm I'll try something.. but console gave me this error:
    ... attempt to call method 'GetTarget' <a nil value>

    EDIT: Tried this but still casts on itself.
    Code:
    	local Target = Antza:GetClosestPlayer()
    	Antza:FullCastSpellOnTarget(37538, Target)
    EDIT2: Now I know what's wrong!! In the spell description it says: Creates an Anti-Magic shell around the caster! :P So ill find another spell.
    Thanks stoneharry :P Thread Closed
    Last edited by Beasthuntah; 06-02-2009 at 04:05 PM.

Similar Threads

  1. [Lua] Help with script - RemoveEvents() bugged
    By gospag in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 04-09-2010, 12:07 PM
  2. [LUA] Help with Teleporter.
    By iRyuzaki in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 06-12-2009, 07:43 PM
  3. Need help with Gossip Lua with Functions (3 rep to whoever fixes)
    By stoneharry in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 12-14-2008, 03:30 PM
  4. Need Help with Gossip
    By Edude in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 10-31-2008, 03:29 PM
  5. [Help] i need Lua help with this script...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 25
    Last Post: 03-03-2008, 03:45 PM
All times are GMT -5. The time now is 05:05 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