LUA Not Working. menu

User Tag List

Results 1 to 8 of 8
  1. #1
    pplzperson's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Not Working.

    Alright here is the LUA script I'm using.

    Code:
    function Teleporter_EnterCombat(Unit, Event)
    	Unit:SendChatMessage(12, 0, "I OWN u")
    	Unit:RegisterEvent("phase1", 9000, 0)
    end 
    
    function phase1(Unit, Event)
    	if Unit:GetHealthPct() < 75 then
    	    Unit:RemoveEvents()
    		Unit:SendChatMessage(12, 0, "You don't stand a chance!")
    		Unit:FullCastSpellOnTarget(38946, Unit:GetRandomPlayer(0))
    		Unit:FullCastSpellOnTarget(34119, 9000)
    		Unit:RegisterEvent("phase2", 9000, 0)
    	end
    end 
    
    function phase2(Unit, Event)
    	if Unit:GetHealthPct() < 55 then
    	Unit:RemoveEvents()
    	Unit:SendChatMessage(12, 0, "You have great power, but it ends now")
    	Unit:CastSpell(41107)
    end
    end
    RegisterUnitEvent(9000, 1, "Teleporter_EnterCombat")
    When I fix one problem, another one comes up =\

    Right now I have one I can't get passed
    bad argument #1 to 'FullCastSpellOnTarget' <Unit expected, got number>
    Isn't FullCastSpellOnTarget supposed to be
    FullCastSpellOnTarget(spellID, unitID)

    Thanks for your time.

    LUA Not Working.
  2. #2
    Power of Illuminati's Avatar Contributor
    Reputation
    179
    Join Date
    May 2008
    Posts
    1,410
    Thanks G/R
    6/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, it should be as the once you wrote before. Unit:GetRandomPlayer(x) where x is a number. 0 is for example a random player.

  3. #3
    pplzperson's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't get how to use =\
    Should I replace "x" with "Unit"?

  4. #4
    Power of Illuminati's Avatar Contributor
    Reputation
    179
    Join Date
    May 2008
    Posts
    1,410
    Thanks G/R
    6/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try with 0 and see if it works only.

  5. #5
    pplzperson's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    0 doesn't work with it.

  6. #6
    EcHoEs's Avatar lol why u mad
    Reputation
    374
    Join Date
    Sep 2006
    Posts
    1,647
    Thanks G/R
    3/1
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    random_any = 0,

    random_in_shortrange = 1,

    random_in_midrange = 2,

    random_in_longrange = 3,

    random_with_mana = 4,

    random_with_rage = 5,

    random_with_energy = 6,

    random_not_maintank= 7


  7. #7
    pplzperson's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know that, but why does the server give me an error?
    Should I put "random_any" there instead?

  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)
    Originally Posted by pplzperson View Post
    Alright here is the LUA script I'm using.

    Code:
    function Teleporter_EnterCombat(Unit, Event)
        Unit:SendChatMessage(12, 0, "I OWN u")
        Unit:RegisterEvent("phase1", 9000, 0)
    end 
     
    function phase1(Unit, Event)
        if Unit:GetHealthPct() < 75 then
            Unit:RemoveEvents()
            Unit:SendChatMessage(12, 0, "You don't stand a chance!")
            Unit:FullCastSpellOnTarget(38946, Unit:GetRandomPlayer(0))
            Unit:FullCastSpellOnTarget(34119, 9000)
            Unit:RegisterEvent("phase2", 9000, 0)
        end
    end 
     
    function phase2(Unit, Event)
        if Unit:GetHealthPct() < 55 then
        Unit:RemoveEvents()
        Unit:SendChatMessage(12, 0, "You have great power, but it ends now")
        Unit:CastSpell(41107)
    end
    end
    RegisterUnitEvent(9000, 1, "Teleporter_EnterCombat")
    When I fix one problem, another one comes up =

    Right now I have one I can't get passed


    Isn't FullCastSpellOnTarget supposed to be
    FullCastSpellOnTarget(spellID, unitID)

    Thanks for your time.
    Try this:


    Code:
    function Teleporter_EnterCombat(Unit, Event)
    Code:
       Unit:SendChatMessage(12, 0, "I OWN u")
       Unit:RegisterEvent("phase1", 9000, 0)
    end 
     
    function phase1(Unit, Event)
       if Unit:GetHealthPct() < 75 then
           Unit:RemoveEvents()
           Unit:SendChatMessage(12, 0, "You don't stand a chance!")
           Unit:FullCastSpellOnTarget(38946, Unit:GetRandomPlayer())
           Unit:FullCastSpellOnTarget(34119, 9000)
           Unit:RegisterEvent("phase2", 9000, 0)
       end
    end 
     
    function phase2(Unit, Event)
       if Unit:GetHealthPct() < 55 then
       Unit:RemoveEvents()
       Unit:SendChatMessage(12, 0, "You have great power, but it ends now")
       Unit:CastSpell(41107)
    end
    end
    RegisterUnitEvent(9000, 1, "Teleporter_EnterCombat")

    World best PvP Paladin=Me? GG ;D


Similar Threads

  1. [ArcEmu] LUA not working.. Any ideas?
    By tiesmik in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 02-21-2011, 11:22 AM
  2. brand new lua(not working in game need help)
    By Flake0207 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 06-24-2009, 04:03 PM
  3. LUA Not Working?
    By Protyke in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 04-26-2009, 03:18 AM
  4. TeleporterNPC.lua not working!
    By _DEFiANT in forum WoW EMU Questions & Requests
    Replies: 12
    Last Post: 08-26-2008, 01:24 AM
  5. [Help] Lua not working
    By Lich King in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 03-15-2008, 04:41 PM
All times are GMT -5. The time now is 05:58 PM. 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