Two gossip npc's on the same script. menu

User Tag List

Results 1 to 5 of 5
  1. #1
    sora2810's Avatar Private
    Reputation
    2
    Join Date
    Nov 2010
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Two gossip npc's on the same script.

    Hi, I wanted to make a script that relayed a chat message every two minutes. So far I got
    Guard:
    Code:
    local guard = 18790
    function guardshout(Unit, Event)
    Unit:RegisterEvent("Yell", 30800, 0)
    end
    
    function Yell(Unit, Event)
    local chance == math.random(1,3)
    if(chance == 1) then
    Unit:Emote(27, 0)
    Unit:SendChatMessage(12, 0, "Quiet you!")
    end
    if(chance == 2)then
    Unit:Emote(15, 0)
    Unit:SendChatMessage(14, 0, "I don't care!")
    end
    if(chance == 1)then
    Unit:Emote(29, 0)
    Unit:SendChatMessage(14, 0, "You sure about that?")
    end
    end
    
    RegisterUnitEvent(guard, 18, "guardshout")
    Terrorized citizen - Has been nulled until I could figure it out.:
    Code:
    local harrassed = 18792
    local guard = 18790
    
    function guyshout(Unit, Event)
    Unit:RegisterEvent("Shout", 30000, 0)
    end
    
    function Shout(Unit, Event)
    local chance == math.random(1,3)
    if(chance == 1)then
    Unit:Emote(20, 0)
    Unit:SendChatMessage(14, 0, "Please... you don't have to do this!")
    end
    if(chance == 2)then
    Unit:Emote(20, 0)
    Unit:SendChatMessage(14, 0, "I don't want to dance!")
    end
    if(chance == 3)then
    Unit:Emote(20, 0)
    Unit:SendChatMessage(14, 0, "I have kids!")
    end
    end
    
    RegisterUnitEvent(harrassed, 18, "guyshout")
    
    
    --Guards turn!
    
    local guard = 18790
    function guardshout(Unit, Event)
    Unit:RegisterEvent("Yell", 6800, 0)
    end
    
    function Yell(Unit, Event)
    if(chance == 1) then
    Unit:Emote(27, 0)
    Unit:SendChatMessage(12, 0, "Quiet you!")
    end
    if(chance == 2)then
    Unit:Emote(15, 0)
    Unit:SendChatMessage(14, 0, "I don't care!")
    end
    if(chance == 1)then
    Unit:Emote(29, 0)
    Unit:SendChatMessage(14, 0, "You sure about that?")
    end
    end
    
    RegisterUnitEvent(guard, 18, "guardshout")
    I = ubernoob. I'm brain-locked. I need to use chance for both functions, and it needs to recycle its self every time. Maybe I'm just overlooking something. I really appreciate any help.
    Last edited by sora2810; 12-01-2010 at 06:57 AM.

    Two gossip npc's on the same script.
  2. #2
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You forgot:
    Code:
    local chance == math.random(1,3)
    On the second function.

    Each npc may be loaded before the other npc, and you want the message to be randomised each time the function is called, and the variable is only declared in one script, hence why you need it in both scripts.

  3. #3
    Zymus's Avatar Active Member
    Reputation
    15
    Join Date
    Sep 2009
    Posts
    87
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, just a bug I noticed:
    Code:
    if(chance == 2)then
    Unit:Emote(15, 0)
    Unit:SendChatMessage(14, 0, "I don't care!")
    end
    if(chance == 1)then
    Unit:Emote(29, 0)
    Unit:SendChatMessage(14, 0, "You sure about that?")
    end
    I think you meant for it to be chance == 2 ... chance == 3, instead of having chance == 1 twice

  4. #4
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Furthermore (just saw reply and saw another bug):

    Code:
     :Emote(emoteid, time)
    You have to put a time, 0 = instant so it won't display. 5000 = 5 seconds.

  5. #5
    sora2810's Avatar Private
    Reputation
    2
    Join Date
    Nov 2010
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    Furthermore (just saw reply and saw another bug):

    Code:
     :Emote(emoteid, time)
    You have to put a time, 0 = instant so it won't display. 5000 = 5 seconds.
    Thanks, I was sorta hurrying to upload it and I completely missed them until I looked it over.

Similar Threads

  1. Two Nemesis kill quests at the same time (Glad Sanctum)
    By Shanka in forum World of Warcraft Exploits
    Replies: 2
    Last Post: 12-14-2014, 10:27 AM
  2. [Trinity] Making npcs spawn at the same time every time even when they die at different time
    By Badcobra10 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 06-03-2011, 12:15 PM
  3. [Lua Script] Running several of the same script
    By newtech in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 11-23-2010, 07:33 PM
  4. Play two wow on the same pc or more
    By bait in forum World of Warcraft General
    Replies: 0
    Last Post: 10-25-2006, 05:21 AM
  5. Is there anyway you can run two WoW on the same pc?
    By bait in forum World of Warcraft General
    Replies: 5
    Last Post: 10-24-2006, 06:42 PM
All times are GMT -5. The time now is 02:36 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search