Bad Argument? with lua menu

User Tag List

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

    Bad Argument? with lua

    i get this message "scripts\king Epirus.lua:40: Bad Argument #1 to 'Fullcastspellontarget' (Unite expected, Got nil)

    Code:
    --[[ King_Epirus.lua
    ********************************
    *                                                            *
    * The LUA++ Scripting Project        *
    *                                                            *
    ********************************
    
    This software is provided as free and open source by the
    staff of The LUA++ Scripting Project, in accordance with 
    the AGPL license. This means we provide the software we have 
    created freely and it has been thoroughly tested to work for 
    the developers, but NO GUARANTEE is made it will work for you 
    as well. Please give credit where credit is due, if modifying,
    redistributing and/or using this software. Thank you.
    
    ~~End of License Agreement
    -- LUA++ staff, April 15, 2008. ]]
    -- $author: Silent
    -- Spells:
    -- Shadowbolt 8439
    -- Polymorph 13323 is buggy, I use 12826
    -- Detonation 9435
    -- Silence 8988
    -- ArcaneBubble 9438
    
    function King_EpirusOnCombat(pUnit, Event)
        print "King_Epirus fight start"
        pUnit:SendChatMessage(12, 0, "You Shall Suffer Within The Eyes Of King Epirus!")
        pUnit:PlaySoundToSet(1398)
        pUnit:RegisterEvent("King_EpirusCast", 6000, 0)
    end
    
    function King_EpirusCast(pUnit, Event)
        local rndcast = math.random(1,4)
    	if (rndcast == 1) then
    	pUnit:FullCastSpellOnTarget(27209, pUnit:GetRandomPlayer(0))
    	elseif (rndcast == 2) then
    	pUnit:FullCastSpellOnTarget(12826, pUnit:GetRandomPlayer(0)) -- (7)Not_Main_Tank crash the server
    	elseif (rndcast == 3) then
    	pUnit:FullCastSpellOnTarget(27209, pUnit:GetRandomPlayer(4))
    	pUnit:RegisterEvent("King_EpirusPhaseTwo", 500, 0)
    end
       end
       
    function King_EpirusPhaseTwo(pUnit, Event)
       if (pUnit:GetHealthPct() < 50) then
       print "King_Epirus phase two start"
       pUnit:FullCastSpell(9438)
       pUnit:SendChatMessage(12, 0, "Defile These Peasents!")
       pUnit:PlaySoundToSet(1396)
       pUnit:FullCastSpell(30414)
       pUnit:RemoveEvents()
       pUnit:RegisterEvent("King_EpirusCast", 5000, 0)
    end
       end
    
    function King_EpirusOnLeaveCombat(pUnit)
       print "King_Epirus players dead"
       pUnit:RemoveEvents()
    end
    
    function King_EpirusOnDied(pUnit)
       print "King_Epirus dead"
       pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(200032, 5, "King_EpirusCast")
    RegisterUnitEvent(200032, 5, "King_EpirusPhaseTwo")
    RegisterUnitEvent(200032, 1, "King_EpirusOnCombat")
    RegisterUnitEvent(200032, 3, "King_EpirusOnLeaveCombat")
    RegisterUnitEvent(200032, 4, "King_EpirusOnDied")
    please i will +Rep if you know how to fix this

    Bad Argument? with lua
  2. #2
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im not a LUA scripter but from looking at it maybe this could be the problem

    Also i seem to remember a post not too long ago about something to do with Fullcastspellontarget being different or somehting..


    Try making these changes to the script.



    RegisterUnitEvent(200032, 5, "King Epirus_Cast")
    RegisterUnitEvent(200032, 5, "King Epirus_PhaseTwo")
    RegisterUnitEvent(200032, 1, "King Epirus_OnCombat")
    RegisterUnitEvent(200032, 3, "King Epirus_OnLeaveCombat")
    RegisterUnitEvent(200032, 4, "King Epirus_OnDied")

  3. #3
    Blackboy0's Avatar Member
    Reputation
    70
    Join Date
    Nov 2007
    Posts
    377
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
     pUnit:FullCastSpellOnTarget(27209, pUnit:GetRandomPlayer(4))
    You cannot have a # in the ()'s. It's just a bug for some Servers out there, and I guess yours is one of 'em. You gotta have a 0 or use a different Target.

  4. #4
    Skype's Avatar Member
    Reputation
    133
    Join Date
    Dec 2007
    Posts
    116
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could also use a local. seems to bypass some things.

    function bear_Start(pUnit, event)
    local Target = pUnit:GetRandomPlayer(0)
    pUnit:FullCastSpellOnTarget(32323, Target)
    end

    RegisterUnitEvent(2354,1,"bear_Start")

    I have the same problem on my server, the local thing seems to go around that bug.



  5. #5
    Blackboy0's Avatar Member
    Reputation
    70
    Join Date
    Nov 2007
    Posts
    377
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Skype View Post
    You could also use a local. seems to bypass some things.

    function bear_Start(pUnit, event)
    local Target = pUnit:GetRandomPlayer(0)
    pUnit:FullCastSpellOnTarget(32323, Target)
    end

    RegisterUnitEvent(2354,1,"bear_Start")

    I have the same problem on my server, the local thing seems to go around that bug.
    For him he would try

    function bear_Start(pUnit, event)
    local Target = pUnit:GetRandomPlayer(4)
    pUnit:FullCastSpellOnTarget(32323, Target)
    end

    RegisterUnitEvent(2354,1,"bear_Start")

    But yah, Locals are helpful. I dunno if they bypass the (#) bug though? I would give it a shot. Tell us what happens

  6. #6
    Cursed's Avatar Contributor
    Reputation
    270
    Join Date
    Jun 2007
    Posts
    1,380
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd say you totally convinced him to cast the spell oO

Similar Threads

  1. [Request] I need some help with lua script (boss on death)
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 03-03-2008, 03:47 PM
  2. [Help] With Lua ...(where to attach it?)
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 13
    Last Post: 02-15-2008, 05:50 PM
  3. After a boss dies, dropping a wall with LUA?
    By C-Death in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 01-29-2008, 09:42 PM
  4. How to make game objects teleport with LUA!
    By Le Froid in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 01-02-2008, 06:59 PM
  5. [Request] Ascent Revision with LUA scripts enabled
    By Greatdrak in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 12-30-2007, 06:04 PM
All times are GMT -5. The time now is 06:12 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