[Lua] Problem.. menu

User Tag List

Results 1 to 15 of 15
  1. #1
    Taberen's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Problem..

    Hello. So i have made a Lua script.. But i cant get it to work ): Please help me..

    Code:
    function LordCurrack_OnEnterCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "I AM LORD CURRACK! I must protect Sasori-Senpai!")
    Unit:RegisterEvent("LordCurrack_Spell1", 60000, 5")
    Unit:RegisterEvent("LordCurrack_Phase1", 5000, 1")
    end
    
    function LordCurrack_Phase1(Unit, Event)
    if Unit:GetHealthPct() <= 75 then
    Unit:SetModel(5048)
    Unit:SendChatMessage(14, 0, "How can it be!? THAT'S IT, BEHOLD THE CURSED DEMON!")
    Unit:CastSpell(20564)
    end
    
    function LordCurrack_Spell1(Unit, event)
    Unit:CastSpellOnTarget(63563,Unit:GetRandomPlayer(0))
    end
    
    function LordCurrack_OnLeaveCombat(Unit, event)
    Unit:RemoveEvents()
    end
    
    function LordCurrack_OnKilledTarget(Unit)
    end
    
    function LordCurrack_OnDied(Unit)
    Unit:SendChatMessage(12, 0, "Sorry Senpai ! I have failed !")
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(99006, 1, "LordCurrack_OnEnterCombat")
    RegisterUnitEvent(99006, 2, "LordCurrack_OnLeaveCombat")
    RegisterUnitEvent(99006, 3, "LordCurrack_OnKilledTarget")
    RegisterUnitEvent(99006, 4, "LordCurrack_OnDied")

    [Lua] Problem..
  2. #2
    foamysquirl's Avatar Member
    Reputation
    5
    Join Date
    Aug 2006
    Posts
    80
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure, but I think I may have found your problem..

    Code:
    function LordCurrack_OnEnterCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "I AM LORD CURRACK! I must protect Sasori-Senpai!")
    Unit:RegisterEvent("LordCurrack_Spell1", 60000, 5")
    Unit:RegisterEvent("LordCurrack_Phase1", 5000, 1")
    end
    
    function LordCurrack_Phase1(Unit, Event)
    if Unit:GetHealthPct() <= 75 then
    Unit:SetModel(5048)
    Unit:SendChatMessage(14, 0, "How can it be!? THAT'S IT, BEHOLD THE CURSED DEMON!")
    Unit:CastSpell(20564)
    end
    
    function LordCurrack_Spell1(Unit, event)
    Unit:CastSpellOnTarget(63563,Unit:GetRandomPlayer(0)) -- What is all of this business?  I am also not sure if this function needs a "0" in its parentheses.
    end
    
    function LordCurrack_OnLeaveCombat(Unit, event)
    Unit:RemoveEvents()
    end
    
    function LordCurrack_OnKilledTarget(Unit, Event)
    end
    
    function LordCurrack_OnDied(Unit, Event)
    Unit:SendChatMessage(12, 0, "Sorry Senpai ! I have failed !")
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(99006, 1, "LordCurrack_OnEnterCombat")
    RegisterUnitEvent(99006, 2, "LordCurrack_OnLeaveCombat")
    RegisterUnitEvent(99006, 3, "LordCurrack_OnKilledTarget")
    RegisterUnitEvent(99006, 4, "LordCurrack_OnDied")
    You will also need to add in the ", Event" s and capitolize the lowercase "e"s I have highlighted in orange.
    You mean you'll answer ALL of my butterfly questions????

  3. #3
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function LordCurrack_OnEnterCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "I AM LORD CURRACK! I must protect Sasori-Senpai!")
    Unit:RegisterEvent("LordCurrack_Spell1", 60000, 5)
    Unit:RegisterEvent("LordCurrack_Phase1", 1000, 0) -- checks every 1 sec if Unit is under 75%.
    end
    
    function LordCurrack_Phase1(Unit, Event)
    if Unit:GetHealthPct() <= 75 then
    Unit:RemoveEvents() -- Remove all the events above
    Unit:RegisterEvent("LordCurrack_Spell1", 60000, 5)
    Unit:SetModel(5048)
    Unit:SendChatMessage(14, 0, "How can it be!? THAT'S IT, BEHOLD THE CURSED DEMON!")
    Unit:CastSpell(20564)
    end
    
    function LordCurrack_Spell1(Unit, Event)
    Unit:CastSpellOnTarget(63563, Unit:GetRandomPlayer(0))
    end
    
    function LordCurrack_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end
    
    function LordCurrack_OnKilledTarget(Unit, Event)
    end
    
    function LordCurrack_OnDied(Unit, Event)
    Unit:SendChatMessage(12, 0, "Sorry Senpai ! I have failed !")
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(99006, 1, "LordCurrack_OnEnterCombat")
    RegisterUnitEvent(99006, 2, "LordCurrack_OnLeaveCombat")
    RegisterUnitEvent(99006, 3, "LordCurrack_OnKilledTarget")
    RegisterUnitEvent(99006, 4, "LordCurrack_OnDied")



    foamysquirl already fixxed some errors^^

    Now your script should work.

    I added the function "LordCurrack_Spell1" to phase1.

    Test it and tell me the errors if you get some.

  4. #4
    Taberen's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay i'll try

  5. #5
    Taberen's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still won't work s:

  6. #6
    Pawaox-Z's Avatar Member
    Reputation
    57
    Join Date
    Dec 2007
    Posts
    176
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function LordCurrack_Combat(Unit, Event)
    Unit:SendChatMEssage(14, 0, "I AM LORD CURRACK! I must protect Sasori-Senpai!")
    Unit:RegisterEvent("LordCurrack_Spell1", 50000, 5)
    end

    function LordCurrack_Phase1(Unit, Event)
    if Unit:GetHealtchPct() < 75 then
    Unit:RemoveEvents();
    Unit:RegisterEvent("LordCurrack_Spell1", 60000, 5)
    Unit:SetModel(504
    Unit:SendChatMessage(14, 0, "How can it be!? THAT's IT, BEHOLD THE CURSED DEMON!")
    Unit:CastSpell(20564)
    end
    end

    function Lord_Currack_LeaveCombat(Unit, Event)
    Unit:RemoveEvents();
    end

    function LordCurrack_Died(Unit, Event)
    Unit:SendChatMessage(12, 0, "Sorry Senpai! I have failed!")
    Unit:RemoveEvents();
    end

    function LordCurrack_Spell1(Unit, Event)
    Unit:CastSpellOnTarget(63563, Unit:GetRandomPlayer(0))
    end

    RegisterUnitEvent(99006, 1, "LordCurrack_Combat")
    RegisterUnitEvent(99006, 1, "LordCurrack_LeaveCombat")
    RegisterUnitEvent(99006, 1, "LordCurrack_Died")
    Should work.

  7. #7
    Vision1000's Avatar Member
    Reputation
    104
    Join Date
    Jun 2008
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Taberen View Post
    Still won't work s:

    When you say it won't work, Do you mean you get an error at startup? Or does he do nothing ingame? Please go into more detail when you say it "doesn't work".

    1). If your boss is doing absoultely nothing. You either messed up the npc's EntryID when registering the events, or Lua is not turned on.

    2). You're getting an error on startup, you had a bunch of funky symbols in your script at first. you might be getting a "Unkown symbol next to "Insert Line of Code here"." Error. Or any other errors.


    Check for those things and post back here.

  8. #8
    Taberen's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Vision1000 View Post

    When you say it won't work, Do you mean you get an error at startup? Or does he do nothing ingame? Please go into more detail when you say it "doesn't work".

    1). If your boss is doing absoultely nothing. You either messed up the npc's EntryID when registering the events, or Lua is not turned on.

    2). You're getting an error on startup, you had a bunch of funky symbols in your script at first. you might be getting a "Unkown symbol next to "Insert Line of Code here"." Error. Or any other errors.


    Check for those things and post back here.
    Yea i know, sorry
    Well. The "Won't Work" part is, that when i go ingame. He says nothing, he does nothing.. No matter what i do..

    The EntryID is easy to remember 99006, and i have made sure several times that i had typed the correct EntryID.
    And lua is turned on, i have made other scripts that work. I don't know what is wrong with this one ?

  9. #9
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this.

    Code:
    function LordCurrack_Combat(Unit, Event)
    Unit:SendChatMessage(14, 0, "I AM LORD CURRACK! I must protect Sasori-Senpai!")
    Unit:RegisterEvent("LordCurrack_Phase1", 1000, 0)
    Unit:RegisterEvent("LordCurrack_Spell1", 60000, 5)
    end
    
    function LordCurrack_Phase1(Unit, Event)
    if Unit:GetHealtchPct() <= 75 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("LordCurrack_Spell1", 60000, 5)
    Unit:SetModel(5048)
    Unit:SendChatMessage(14, 0, "How can it be!? THAT's IT, BEHOLD THE CURSED DEMON!")
    Unit:CastSpell(20564)
    end
    end
    
    function LordCurrack_LeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end
    
    function LordCurrack_Died(Unit, Event)
    Unit:SendChatMessage(12, 0, "Sorry Senpai! I have failed!")
    Unit:RemoveEvents()
    end
    
    function LordCurrack_Spell1(Unit, Event)
    Unit:CastSpellOnTarget(63563, Unit:GetRandomPlayer(0))
    end
    
    RegisterUnitEvent(99006, 1, "LordCurrack_Combat")
    RegisterUnitEvent(99006, 2, "LordCurrack_LeaveCombat")
    RegisterUnitEvent(99006, 4, "LordCurrack_Died")

  10. #10
    Taberen's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ty Dyna. This Almost worked 100% but..
    The Phase won't work. I can get my boss way down under 75 And nothing happens.
    But still ty for fixing the speaking prob.

  11. #11
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem. I think I already know the problem though, there's a typo:
    Code:
    if Unit:GetHealtchPct() <= 75 then
    which should be

    Code:
    if Unit:GetHealthPct() <= 75 then

  12. #12
    Taberen's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so Much!
    Now only one more thing, i have tryed to create more phases. But how do i get more than one phase to work at once?
    Please, i need help for that
    Last edited by Taberen; 06-29-2009 at 08:48 AM.

  13. #13
    Taberen's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please help..

  14. #14
    Vision1000's Avatar Member
    Reputation
    104
    Join Date
    Jun 2008
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Taberen View Post
    Thank you so Much!
    Now only one more thing, i have tryed to create more phases. But how do i get more than one phase to work at once?
    Please, i need help for that
    Code:
    function LordCurrack_Combat(Unit, Event)
    Unit:SendChatMessage(14, 0, "I AM LORD CURRACK! I must protect Sasori-Senpai!")
    Unit:RegisterEvent("LordCurrack_Phase1", 1000, 0)
    Unit:RegisterEvent("LordCurrack_Spell1", 60000, 5)
    end
    
    function LordCurrack_Phase1(Unit, Event)
    if Unit:GetHealtchPct() <= 75 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("LordCurrack_Spell1", 60000, 5)
    Unit:SetModel(5048)
    Unit:SendChatMessage(14, 0, "How can it be!? THAT's IT, BEHOLD THE CURSED DEMON!")
    Unit:CastSpell(20564)
    Unit:RegisterEvent("LordCurrack_Phase2", 1000, 0)
    end
    end
    
    function LordCurrack_Phase2(Unit, Event)
         -- Put what you want in Phase 2 here.
    end
    And if you want more than one phase to work at once, Just merge the two Phases into one phase.
    Last edited by Vision1000; 06-29-2009 at 10:37 AM.

  15. #15
    Taberen's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh ! Thank you! Dammit xd

Similar Threads

  1. Lua problem
    By Minichili in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 04-14-2008, 09:45 AM
  2. [Help] Lua problem
    By Lich King in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 03-23-2008, 04:34 AM
  3. lua problem
    By *Alexz* in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 02-14-2008, 10:41 PM
  4. [Question]-Lua Problem
    By Peter1337 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 02-07-2008, 07:59 AM
  5. [Question] LUA problem
    By Peter1337 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 02-01-2008, 09:21 AM
All times are GMT -5. The time now is 03:50 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