ServerHook OnEmote problem/question menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    bendaferi's Avatar Active Member
    Reputation
    34
    Join Date
    Jun 2008
    Posts
    111
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ServerHook OnEmote problem/question

    Hi,

    I'm making a script which activates when somebody uses /chicken emote.

    I nearly finished my script, my world.exe says there is no problem with the .lua file but when I /emote nothing happens.

    My script looks like this:


    function doesntreallymatter_OnEmote(event, pPlayer, pUnit, emoteId)
    if (emoteId == 19) and pPlayer:GetLevel() < 40 then
    ...
    end
    end

    RegisterServerHook(8, "doesntreallymatter_OnEmote")


    once again: I get no errors in the world.exe and nothing happens ingame : /
    Any suggestions? I give
    +Rep...

    ServerHook OnEmote problem/question
  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)
    Have you tried testing to see what happens when you comment out the if and one of the ends? See if it triggers with any emote. It might be that your emote for chicken is wrong, and if so you know what the problem is and you can find the correct id. Npc emotes are different to player emotes.

  3. #3
    bendaferi's Avatar Active Member
    Reputation
    34
    Join Date
    Jun 2008
    Posts
    111
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    made a test.lua:

    function teszt_OnEmote(pPlayer, event, pUnit, emoteId)
    if (emoteId == 2) then -- bow
    pPlayer:CastSpell(34349) -- simple arcane explosion
    end
    end
    RegisterServerHook(8, "teszt_OnEmote")


    Now my world.exe says script/teszt.lua:5: attempt to index local 'pPlayer' <a number value>

    I guess it doesn't know who the pPlayer is? :O
    Anyway I'll try to find another ID for the /chicken


    ---------- Post added at 02:17 PM ---------- Previous post was at 01:59 PM ----------

    Ok somehow got it work. However functions like pPlayer:SpawnCreature(......) or RegisterTimedEvent(......) aren't working at all...
    Last edited by bendaferi; 07-09-2010 at 02:09 PM.

  4. #4
    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)
    Originally Posted by bendaferi View Post
    made a test.lua:

    function teszt_OnEmote(pPlayer, event, pUnit, emoteId)
    if (emoteId == 2) then -- bow
    pPlayer:CastSpell(34349) -- simple arcane explosion
    end
    end
    RegisterServerHook(8, "teszt_OnEmote")


    Now my world.exe says script/teszt.lua:5: attempt to index local 'pPlayer' <a number value>

    I guess it doesn't know who the pPlayer is? :O
    Anyway I'll try to find another ID for the /chicken


    ---------- Post added at 02:17 PM ---------- Previous post was at 01:59 PM ----------

    Ok somehow got it work. However functions like pPlayer:SpawnCreature(......) or RegisterTimedEvent(......) aren't working at all...
    Your parameters are wrong.

    OnEmote(event, pPlayer, pUnit, emoteId)

    Are the correct parameters. And yes order matters. At the moment it's thinking the event (which would be is trying to cast the spell, which is obviously going to return nil.

    Last edited by stoneharry; 07-09-2010 at 03:01 PM.

  5. #5
    bendaferi's Avatar Active Member
    Reputation
    34
    Join Date
    Jun 2008
    Posts
    111
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bah that's new! Thanks for the info

  6. #6
    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)
    OnEmote(event, pPlayer, pUnit, emoteId)
    print("This is the event variable "..event..".")
    print("This is the pPlayer variable "..pPlayer..".")
    print("This is the pUnit variable "..pUnit..".")
    print("This is the emoteId variable "..emoteId..".")
    end

    RegisterServerHook(8, "teszt_OnEmote")

    Since it's not working do me a favour and use that above script, and tell me what it says in console.

  7. #7
    bendaferi's Avatar Active Member
    Reputation
    34
    Join Date
    Jun 2008
    Posts
    111
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It says "scripts\teszt.lua:6: attempt to concatenate local 'pPlayer' <a userdate value> :confused:

  8. #8
    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)
    Originally Posted by bendaferi View Post
    It says "scripts\teszt.lua:6: attempt to concatenate local 'pPlayer' <a userdate value> :confused:
    Use the EXACT same script I linked you, it should be printing what the variables are, it's not possible for it to error.

  9. #9
    bendaferi's Avatar Active Member
    Reputation
    34
    Join Date
    Jun 2008
    Posts
    111
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I used the EXACT same script you wrote but still get error that says: "....:6:' <eof> ' expected near 'end'
    And once again:

    OnEmote(event, pPlayer, pUnit, emoteId)
    print("This is the event variable "..event..".")
    print("This is the pPlayer variable "..pPlayer..".")
    print("This is the pUnit variable "..pUnit..".")
    print("This is the emoteId variable "..emoteId..".")
    end

    RegisterServerHook(8, "teszt_OnEmote")

    I used this, but I don't really get it... why didn't we put function at the start and why do we register as teszt_OnEmote when our "function" is OnEmote.
    Anyway, you are the boss Getting errors with your script sorry.


    ---------- Post added at 05:00 PM ---------- Previous post was at 04:59 PM ----------

    Woooops DING* Sergeant rank <3

  10. #10
    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)
    Originally Posted by bendaferi View Post
    Well I used the EXACT same script you wrote but still get error that says: "....:6:' <eof> ' expected near 'end'
    And once again:

    OnEmote(event, pPlayer, pUnit, emoteId)
    print("This is the event variable "..event..".")
    print("This is the pPlayer variable "..pPlayer..".")
    print("This is the pUnit variable "..pUnit..".")
    print("This is the emoteId variable "..emoteId..".")
    end

    RegisterServerHook(8, "teszt_OnEmote")

    I used this, but I don't really get it... why didn't we put function at the start and why do we register as teszt_OnEmote when our "function" is OnEmote.
    Anyway, you are the boss Getting errors with your script sorry.


    ---------- Post added at 05:00 PM ---------- Previous post was at 04:59 PM ----------

    Woooops DING* Sergeant rank <3
    Because I was an idiot and forgot that part. >_>

    Change the first line to:

    function teszt_OnEmote(event, pPlayer, pUnit, emoteId)


  11. #11
    bendaferi's Avatar Active Member
    Reputation
    34
    Join Date
    Jun 2008
    Posts
    111
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh I think I got it now. Without the "if (emoteId == 2) then" line any emote I do ingame will be printed on console right?

    After /cry it says:

    This is the event variable 8.
    (and here comes the error which occured previously too)
    scripts\teszt2:3: attempt to concatenate local 'pPlayer' <a userdate value>

    And I get these 2 message after each emotes.

  12. #12
    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)
    Originally Posted by bendaferi View Post
    Ahh I think I got it now. Without the "if (emoteId == 2) then" line any emote I do ingame will be printed on console right?

    After /cry it says:

    This is the event variable 8.
    (and here comes the error which occured previously too)
    scripts\teszt2:3: attempt to concatenate local 'pPlayer' <a userdate value>

    And I get these 2 message after each emotes.
    If you use the script I linked when you use any emote to the player it will print out all the variables that can be used, so that you can see why it is giving you that error. Print is a default Lua command which means it's impossible for it to return an error... Almost.


  13. #13
    bendaferi's Avatar Active Member
    Reputation
    34
    Join Date
    Jun 2008
    Posts
    111
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well here is the whole script. And it gives error.

    function teszt_OnEmote(event, pPlayer, pUnit, emoteId)
    print("This is the event variable "..event..".")
    print("This is the pPlayer variable "..pPlayer..".")
    print("This is the pUnit variable "..pUnit..".")
    print("This is the emoteId variable "..emoteId..".")
    end
    RegisterServerHook(8, "teszt_OnEmote")


    ---------- Post added at 05:30 PM ---------- Previous post was at 05:28 PM ----------

    I'll try it with your Kronos repack this morning. Thank you for your help! See ya, gn!

  14. #14
    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)
    Originally Posted by bendaferi View Post
    Well here is the whole script. And it gives error.

    function teszt_OnEmote(event, pPlayer, pUnit, emoteId)
    print("This is the event variable "..event..".")
    print("This is the pPlayer variable "..pPlayer..".")
    print("This is the pUnit variable "..pUnit..".")
    print("This is the emoteId variable "..emoteId..".")
    end
    RegisterServerHook(8, "teszt_OnEmote")


    ---------- Post added at 05:30 PM ---------- Previous post was at 05:28 PM ----------

    I'll try it with your Kronos repack this morning. Thank you for your help! See ya, gn!
    Using my repack will make no difference, I'm probably making a retarded and obvious mistake. -.- I'll debug it on localhost tomorrow.


  15. #15
    bendaferi's Avatar Active Member
    Reputation
    34
    Join Date
    Jun 2008
    Posts
    111
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ye didn't work on that either. I'm looking forward to see your debug results.

Page 1 of 2 12 LastLast

Similar Threads

  1. Sgather combat/mage problem question
    By dergaten in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 06-11-2011, 03:16 PM
  2. Mound Sound problem/question
    By Uchiha Ottaba in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 02-11-2009, 02:38 AM
  3. [problem/question] noggit problem
    By Ermok in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-24-2007, 10:06 AM
  4. [Question] Problem/Question
    By artaron in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-13-2007, 08:36 AM
  5. Helm fix problem--Question/Request
    By qwert in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 09-08-2007, 06:54 PM
All times are GMT -5. The time now is 01:32 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