Lua GetHealthPct doesnt work? menu

User Tag List

Results 1 to 11 of 11
  1. #1
    thijsd's Avatar Member
    Reputation
    25
    Join Date
    Oct 2007
    Posts
    157
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua GetHealthPct doesnt work?

    Hey there,

    Im scripting a boss, but it doenst work Script:
    Code:
    function TBB_Event(pUnit, event, miscunit, misc)
        if pUnit:GetHealthPct() < 70 then
            pUnit:SetScale(4); -- Grows back to full height if you run.
            pUnit:SendChatMessage(12, 0, "Me big!") 
            pUnit:RemoveEvents();
        end
    end
    RegisterUnitEvent(700002,1, "TBB_Event")
    when i remove the "GetHealthPct" part, it does work. When i attack it now, it slowly dies, but the script is never activated? My Mob had 9k hp.


    Someone? (will give +Rep)

    Lua GetHealthPct doesnt work?
  2. #2
    2dgreengiant's Avatar ★ Elder ★


    Reputation
    1192
    Join Date
    Feb 2007
    Posts
    7,129
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does and error appear in ascent-world.exe?
    If you need me you have my skype, if you don't have my skype then you don't need me.

  3. #3
    thijsd's Avatar Member
    Reputation
    25
    Join Date
    Oct 2007
    Posts
    157
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, it doesnt.

  4. #4
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RegisterUnitEvent(700002,1, "TBB_Event")

    This tells the server to run function TBB_Event once when event 1 is happening (On aggro? Can't remember.)

    You'll need to register an event like this:
    pUnit:RegisterEvent(1000, 0, "TBB_Event");
    This tells the server to run TBB_Event every 1000 for 0 (=infinite) times.
    Don't forget to remove the event afterwards.

  5. #5
    thijsd's Avatar Member
    Reputation
    25
    Join Date
    Oct 2007
    Posts
    157
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by TheSpidey View Post
    RegisterUnitEvent(700002,1, "TBB_Event")

    This tells the server to run function TBB_Event once when event 1 is happening (On aggro? Can't remember.)

    You'll need to register an event like this:
    pUnit:RegisterEvent(1000, 0, "TBB_Event");
    This tells the server to run TBB_Event every 1000 for 0 (=infinite) times.
    Don't forget to remove the event afterwards.
    TNX +Rep

    (Btw 1 = OnEnterCombat )

  6. #6
    thijsd's Avatar Member
    Reputation
    25
    Join Date
    Oct 2007
    Posts
    157
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm.... 0 doesnt work?! (didnt test it, becouse i was away, im home now, tested it, but doesnt work :P)

  7. #7
    thijsd's Avatar Member
    Reputation
    25
    Join Date
    Oct 2007
    Posts
    157
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed it, it was

    pUnit:RegisterEvent("TBB_Event",1000,0)

  8. #8
    Arthas117's Avatar Knight-Champion
    Reputation
    151
    Join Date
    Mar 2007
    Posts
    483
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Damnit I got this problem sometimes also xD 90% of my errors in LUA is all about GetHealthPct I think you should compile it, I dunno...

    World best PvP Paladin=Me? GG ;D


  9. #9
    thijsd's Avatar Member
    Reputation
    25
    Join Date
    Oct 2007
    Posts
    157
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nah it working totaly now :P need to add pUnit:RegisterEvent("TBB_Event",1000,0)

  10. #10
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have fun

  11. #11
    thijsd's Avatar Member
    Reputation
    25
    Join Date
    Oct 2007
    Posts
    157
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha ty :P
    There are only 10 kinds of people in the world.
    People who understand binary and those who don't.

Similar Threads

  1. [Lua Script] (Solved) Lua suicide doesnt work.. would like some help.
    By DaynNight in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 02-03-2012, 03:40 PM
  2. Lua script doesnt work (trying to script Kurinnaxx)
    By zlo in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 08-14-2008, 04:35 PM
  3. Ive notest lua doesnt work when map id is -0- Or does it?
    By Tom_2001 in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 02-01-2008, 04:55 PM
  4. [Question] My .lua doesnt work
    By Creepfold in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 12-20-2007, 07:32 PM
  5. How come pvp doesnt work????!?!
    By flop159 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 10-08-2007, 10:59 AM
All times are GMT -5. The time now is 07:20 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