Quick Scripting Fix needed... (I'm not the best scripter) menu

Shout-Out

User Tag List

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

    Quick Scripting Fix needed... (I'm not the best scripter)

    Hey, could someone please help me fix this script?

    I keep getting Tried to call Invalid LUA Function 'Boss_OnEnterCombat' from Ascent (unit)!

    Here's the script:

    Code:
    function Boss_Spell1(unit)
    unit:CastSpell(41150)
    unit:SendChatMessage(12, 0, "Run, run for your lives pitiful mortals...")
    end
    
    function Boss_Spell2(unit)
    unit:CastSpell(45302)
    unit:SendChatMessage(12, 0, "Feel the chaos flow...")
    end
    
    function Boss_Spell3(unit)
    local plr = unit:GetClosestPlayer()
    if (plr ~= nil) then
    unit:CastSpellOnTarget(39568, plr) 
    end
    
    function Boss_SunderArmor(unit)
    local plr = unit:GetClosestPlayer()
    if (plr ~= nil) then
    unit:FullCastSpellOnTarget(30901, plr) 
    end
    end
    
    function Boss_OnEnterCombat(unit)
    unit:SendChatMessage(12, 0, "You've made a grave error...")
    unit:RegisterUnitEvent("Boss_Spell1",23000, 0)
    unit:RegisterUnitEvent("Boss_SunderArmor",10000, 0)
    unit:RegisterUnitEvent("Boss_Spell2",50000, 0)
    unit:RegisterUnitEvent("Boss_Spell3",120000, 0) 
    end
    end
    
    function Boss_OnLeaveCombat(unit)
    unit:RemoveEvents()
    end
    
    function Boss_KilledTarget(unit)
    unit:SendChatMessage(12, 0, "All dressed up and nowhere to go...")
    unit:RemoveEvents()
    end
    
    function Boss_OnDied(unit)
    unit:SendChatMessage(12, 0, "BEHOLD! The true power of chaos reigns...")
    unit:RemoveEvents()
    end
    
    
    
    RegisterUnitEvent(90227, 1, "Boss_OnEnterCombat")
    RegisterUnitEvent(90227, 2, "Boss_OnLeaveCombat")
    RegisterUnitEvent(90227, 3, "Boss_OnKilledTarget")
    RegisterUnitEvent(90227, 4, "Boss_onDied")
    any help would be much appreciated...

    Quick Scripting Fix needed... (I'm not the best scripter)
  2. #2
    bill45's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what I saw at first glance if you get anymore errors say so. but here is that part of the code fixed.



    Code:
    function Boss_OnEnterCombat(unit)
    unit:SendChatMessage(12, 0, "You've made a grave error...")
    unit:RegisterEvent("Boss_Spell1",23000, 0)
    unit:RegisterEvent("Boss_SunderArmor",10000, 0)
    unit:RegisterEvent("Boss_Spell2",50000, 0)
    unit:RegisterEvent("Boss_Spell3",120000, 0) 
    end
    Also if you want you might want to change this
    Code:
    function Boss_KilledTarget(unit)
    unit:SendChatMessage(12, 0, "All dressed up and nowhere to go...")
    unit:RemoveEvents()
    end
    to this
    Code:
    function Boss_KilledTarget(unit)
    unit:SendChatMessage(12, 0, "All dressed up and nowhere to go...")
    end
    You don't have to but sometimes when they kill a target they also stop casting their spells all together with that remove events in.

    Also I change this code for you because you forgot the 2nd end

    Code:
    function Boss_Spell3(unit)
    local plr = unit:GetClosestPlayer()
    if (plr ~= nil) then
    unit:CastSpellOnTarget(39568, plr) 
    end
    end
    Last edited by bill45; 06-04-2008 at 08:18 PM.

  3. #3
    Bapesy's Avatar Banned
    Reputation
    35
    Join Date
    May 2008
    Posts
    126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ran it through my LUA checker and it came out with no errors. Your LUA engine is probably out of date.

    Bapes

  4. #4
    adarant_dru's Avatar Member
    Reputation
    1
    Join Date
    May 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    `end' expected (to close `function' at line 11) near `<eof>'

    thats what I'm getting now... thanks for the quick reply btw.

    LOL, this is what I get for putting off learning programming languages... BTW, where would be the best place to get an updated LUA Engine?
    Last edited by adarant_dru; 06-04-2008 at 08:21 PM.

  5. #5
    bill45's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    made a couple of changes in the past few minutes on the same post check those and see if it works.

  6. #6
    adarant_dru's Avatar Member
    Reputation
    1
    Join Date
    May 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey, worked perfectly now! Thanks a lot.
    BTW, one more question, if I wanted another MoB to spawn after the Boss dies, what function could do that?

  7. #7
    bill45's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Example script if you need any more explanation post again. This will spawn the creature you want for on the body of the one that died for 40secs then they disappear.

    Code:
    function Halfbody_Death(unit)
    x = unit:GetX()
    y = unit:GetY()
    z = unit:GetZ()
    unit:SpawnCreature(65025, x, y, z, 0, 148, 40000)
    unit:RemoveEvents()
    end
    
    
    
    RegisterUnitEvent(65027, 4, "Halfbody_Death")

  8. #8
    adarant_dru's Avatar Member
    Reputation
    1
    Join Date
    May 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mmm ok, what about spawning a creature with no time limit?

  9. #9
    bill45's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never bothered to try it but change that 40000 to a 0 and that should make him last forever. If that doesn't work your stuck with a really big number or how ever long you want him to last like an hour or something.

Similar Threads

  1. [REQUEST] Logo needed! Will pay $ to the best one!
    By Nazomi in forum Art & Graphic Design
    Replies: 15
    Last Post: 11-13-2010, 12:45 PM
  2. Advanced script, fix needed.
    By Freefall552 in forum WoW UI, Macros and Talent Specs
    Replies: 1
    Last Post: 10-30-2010, 03:47 AM
  3. Need a Coder for a Few Quick Scripts
    By HellgFails in forum Programming
    Replies: 2
    Last Post: 02-19-2009, 05:42 PM
All times are GMT -5. The time now is 12:44 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