LUA Error menu

User Tag List

Thread: LUA Error

Results 1 to 6 of 6
  1. #1
    Linkn's Avatar Contributor
    Reputation
    90
    Join Date
    Mar 2009
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Error

    This is my first Lua script and its very basic I know, but It still will not work on my server. It loads fine but in game the npc does nothing but melee. Could anyone take a look at this and tell me whats wrong maybe?
    Edit: New script at bottom, still phases do not work.
    Last edited by Linkn; 04-08-2009 at 06:10 PM.

    LUA Error
  2. #2
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Replace all occurrences of pUnit:CastSpell with pUnit:CastSpellOnTarget.

    Oh and remove "pUnit:FullCastSpell(0)"

  3. #3
    Linkn's Avatar Contributor
    Reputation
    90
    Join Date
    Mar 2009
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright thanks, I have worked on the script and its a little more advanced.. He mortal strikes the main tank as intended and stuns but the phases do not work.
    Last edited by Linkn; 04-08-2009 at 06:08 PM.

  4. #4
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here, this should fix it.




    function Dreadbone_Captain_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Ahooy! What have we here?!")
    Unit:RegisterEvent("Dreadbone_Captain_Spell1", 7000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Spell2", 9000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Spell3", 15000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Phase1", 1000, 0)
    end

    function Dreadbone_Captain_Spell1(pUnit, Event)
    pUnit:FullCastSpellOnTarget(43441, pUnit:GetMainTank())
    end

    function Dreadbone_Captain_Spell2(pUnit, Event)
    pUnit:FullCastSpellOnTarget(52885, pUnit:GetRandomPlayer(4))
    end

    function Dreadbone_Captain_Spell3(pUnit,Event)
    pUnit:FullCastSpellOnTarget(42435, pUnit:GetMainTank())
    end

    function Dreadbone_Captain_Spell5(pUnit,Event)
    pUnit:FullCastSpellOnTarget(37591, pUnit:GetMainTank())
    end

    function Dreadbone_Captain_Spell6(pUnit,Event)
    pUnit:FullCastSpellOnTarget(29574, pUnit:GetMainTank())
    end

    function Dreadbone_Captain_Spell7(pUnit,Event)
    pUnit:CastSpell(55262, pUnit:GetMainTank())
    end

    function Dreadbone_Captain_Phase1(pUnit, Event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:RemoveEvents();
    pUnit:FullCastSpell(37591)
    pUnit:RegisterEvent("Dreadbone_Captain_Spell5", 60000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Phase2", 1000, 0)
    end
    end

    function Dreadbone_Captain_Phase2(Unit, Event)
    if Unit:GetHealthPct() <= 25 then
    pUnit:RemoveEvents();
    Unit:SendChatMessage(14, 0, "Perhaps I underestimated ye!")
    Unit:FullCastSpell(29574)
    pUnit:RegisterEvent("Dreadbone_Captain_Spell6", 2000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Phase3", 1000, 0)
    end
    end

    function Dreadbone_Captain_Phase3(Unit, Event)
    if Unit:GetHealthPct() <= 10 then
    pUnit:RemoveEvents();
    Unit:SetScale(2)
    Unit:SendChatMessage(14, 0, "How...are...you..ALIVE!?")
    Unit:CastSpell(52262)
    pUnit:RegisterEvent("Dreadbone_Captain_Spell7", 2000, 0)
    end
    end

    function Dreadbone_Captain_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "As I thought! Run ye land lubbers!")
    end

    function Dreadbone_Captain_OnDied(Unit, Event)
    Unit:RemoveEvents() Unit:SendChatMessage(14, 0, "How could this be...")
    end

    function Dreadbone_Captain_OnKilledTarget(Unit, Event) Unit:SendChatMessage(14, 0, "Hah! Is that all ye got?")
    end

    RegisterUnitEvent(133702,1,"Dreadbone_Captain_OnCombat")
    RegisterUnitEvent(133702,2,"Dreadbone_Captain_OnLeaveCombat")
    RegisterUnitEvent(133702,3,"Dreadbone_Captain_OnKilledTarget")
    RegisterUnitEvent(133702,4,"Dreadbone_Captain_OnDied")

  5. #5
    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)
    You had some Unit and pUnit Errors

    try this


    Code:
    function Dreadbone_Captain_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Ahooy! What have we here?!")
    Unit:RegisterEvent("Dreadbone_Captain_Spell1", 7000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Spell2", 9000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Spell3", 15000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Phase1", 1000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Phase2", 1000, 0)
    Unit:RegisterEvent("Dreadbone_Captain_Phase3", 1000, 0)
    end
    
    function Dreadbone_Captain_Spell1(pUnit, Event)
    pUnit:FullCastSpellOnTarget(43441, pUnit:GetMainTank())
    end
    
    function Dreadbone_Captain_Spell2(pUnit, Event)
    pUnit:FullCastSpellOnTarget(52885, pUnit:GetRandomPlayer(4))
    end
    
    function Dreadbone_Captain_Spell3(pUnit,Event)
    pUnit:FullCastSpellOnTarget(42435, pUnit:GetMainTank())
    end
    
    function Dreadbone_Captain_Spell5(pUnit,Event)
    pUnit:FullCastSpellOnTarget(37591, pUnit:GetMainTank())
    end
    
    function Dreadbone_Captain_Spell6(pUnit,Event)
    pUnit:FullCastSpellOnTarget(29574, pUnit:GetMainTank())
    end
    
    function Dreadbone_Captain_Spell7(pUnit,Event)
    pUnit:CastSpell(55262, pUnit:GetMainTank())
    end
    
    function Dreadbone_Captain_Phase1(pUnit, Event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:RemoveEvents();
    pUnit:FullCastSpell(37591)
    pUnit:RegisterEvent("Dreadbone_Captain_Spell5", 60000, 0)
    end
    end
    
    function Dreadbone_Captain_Phase2(pUnit, Event)
    if pUnit:GetHealthPct() <= 25 then
    pUnit:RemoveEvents();
    pUnit:SendChatMessage(14, 0, "Perhaps I underestimated ye!")
    pUnit:FullCastSpell(29574)
    pUnit:RegisterEvent("Dreadbone_Captain_Spell6", 2000, 0)
    end
    end
    
    function Dreadbone_Captain_Phase3(pUnit, Event)
    if pUnit:GetHealthPct() <= 10 then
    pUnit:RemoveEvents();
    pUnit:SetScale(2)
    pUnit:SendChatMessage(14, 0, "How...are...you..ALIVE!?")
    pUnit:CastSpell(52262)
    pUnit:RegisterEvent("Dreadbone_Captain_Spell7", 2000, 0)
    end
    end
    
    function Dreadbone_Captain_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "As I thought! Run ye land lubbers!")
    end
    
    function Dreadbone_Captain_OnDied(Unit, Event)
    Unit:RemoveEvents() Unit:SendChatMessage(14, 0, "How could this be...")
    end
    
    function Dreadbone_Captain_OnKilledTarget(Unit, Event) Unit:SendChatMessage(14, 0, "Hah! Is that all ye got?")
    end
    
    RegisterUnitEvent(133702,1,"Dreadbone_Captain_OnCombat")
    RegisterUnitEvent(133702,2,"Dreadbone_Captain_OnLeaveCombat")
    RegisterUnitEvent(133702,3,"Dreadbone_Captain_OnKilledTarget")
    RegisterUnitEvent(133702,4,"Dreadbone_Captain_OnDied")

  6. #6
    Linkn's Avatar Contributor
    Reputation
    90
    Join Date
    Mar 2009
    Posts
    296
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit: Fixed it alot but he still only Mortal Strikes, Stuns, rends and the fight basically ends at 75%. Phase1 starts and nothing happens from there on. Here it is..

    ________________________________________________________________________________ ___

    Code:
    function pirate_OnCombat(Unit, Event) 
    Unit:SendChatMessage(14, 0, "Ahoooy!! What is this here?")
    Unit:RegisterEvent("pirate_spell1", 10000, 0)
    Unit:RegisterEvent("pirate_spell2", 20000, 0)
    Unit:RegisterEvent("pirate_spell3", 9000, 0)
    Unit:RegisterEvent("pirate_spell4", 15000, 0)
    Unit:RegisterEvent("pirate_phase1",1000,0)
    Unit:RegisterEvent("pirate_phase2",1000,0)
    Unit:RegisterEvent("pirate_phase3",1000,0)
    end
    
    function pirate_spell1(pUnit, Event) 
    pUnit:FullCastSpellOnTarget(29572, pUnit:GetMainTank()) 
    end
    
    function pirate_spell2(pUnit, Event) 
    pUnit:FullCastSpellOnTarget(59343, pUnit:GetClosestPlayer()) 
    end
    
    function pirate_spell3(pUnit, Event) 
    pUnit:FullCastSpellOnTarget(42435, pUnit:GetMainTank()) 
    end
    
    function pirate_spell4(pUnit, Event) 
    pUnit:FullCastSpellOnTarget(52885, pUnit:GetRandomPlayer(4)) 
    end
    
    function pirate_spell5(pUnit, Event) 
    pUnit:FullCastSpellOnTarget(37591, pUnit:GetClosestPlayer()) 
    end
    
    function pirate_spell6(pUnit, Event) 
    pUnit:CastSpell(41098, pUnit:GetClosestPlayer()) 
    end
    
    function pirate_spell7(pUnit, Event) 
    pUnit:CastSpell(60019, pUnit:GetClosestPlayer()) 
    end
    
    function pirate_spell8(pUnit, Event) 
    pUnit:FullCastSpellOnTarget(38846, pUnit:GetMainTank()) 
    end
    
    function pirate_spell9(pUnit, Event) 
    pUnit:CastSpell(37605, pUnit:GetClosestPlayer()) 
    end
    
    function pirate_spell10(pUnit, Event) 
    pUnit:CastSpell(46924, pUnit:GetMainTank()) 
    end
    
    function pirate_phase1(pUnit, Event) 
    if pUnit:GetHealthPct() < 75 then 
    pUnit:RemoveEvents(); 
    pUnit:FullCastSpell(0)
    end 
    end
    
    function pirate_phase2(pUnit, Event) 
    if pUnit:GetHealthPct() < 50 then 
    pUnit:RemoveEvents(); 
    pUnit:FullCastSpell(0)
    end 
    end
    
    function pirate_phase3(pUnit, Event) 
    if pUnit:GetHealthPct() < 25 then 
    pUnit:RemoveEvents(); 
    pUnit:FullCastSpell(0)
    end 
    end
    
    function pirate_OnLeaveCombat(Unit, Event) 
    Unit:RemoveEvents() 
    Unit:SendChatMessage(14, 0, "Run ye dogs!! Hail to thy leader!") 
    end
    
    function pirate_OnDied(Unit, Event) 
    Unit:RemoveEvents() 
    Unit:SendChatMessage(14, 0, "How...could this...happen...") 
    end
    
    function pirate_OnKilledTarget(Unit, Event) 
    Unit:SendChatMessage(14, 0, "Is that all ye got!?") 
    end
    
    RegisterUnitEvent(133702, 1, "pirate_OnCombat")
    RegisterUnitEvent(133702, 2, "pirate_OnLeaveCombat")
    RegisterUnitEvent(133702, 3, "pirate_OnKilledTarget")
    RegisterUnitEvent(133702, 4, "pirate_OnDied")
    Last edited by Linkn; 04-08-2009 at 06:07 PM.

Similar Threads

  1. [Help] Lua Error (eof)
    By Moffeman in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 06-19-2008, 01:48 PM
  2. LUA error
    By mager1794 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 05-23-2008, 07:17 PM
  3. LUA Error.
    By controlsx2 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 05-07-2008, 04:31 PM
  4. [Lua] Error
    By ~ViVo~ in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-15-2008, 11:15 AM
  5. [Errorz] A Lua Error I Havent seen before
    By Snailz in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 02-14-2008, 10:12 AM
All times are GMT -5. The time now is 03:49 AM. 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