Need some LUA help! menu

User Tag List

Results 1 to 3 of 3
  1. #1
    grothar1993's Avatar Member
    Reputation
    1
    Join Date
    Oct 2008
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need some LUA help!

    I'm gonna explain everything like this.
    I make a mob that is like a Warrior and one that is like a Shaman I give them both same Faction flag.

    I want the Shaman to heal the Warrior or himself when either he or the warrior goes under a certain % hp this is what I managed to do for the Shaman.

    The following script don't have the correct spells used but it will be modified l8r, its more like a "test" script, and I haven't yet made the Shaman nor Warrior MOB, using a Bear mob atm ;D

    Code:
    function HordeShaman_OnCombat(pUnit, event)
    pUnit:SendChatMessage(12, 0, "Raaawwh!")
    pUnit:RegisterEvent("LesserHealHorde", 2000, 0)
    pUnit:RegisterEvent("ChainHealHorde", 5000, 0)
    end
    
    function LesserHealHorde(pUnit, event)
    if pUnit:GetHealthPct() >= 40 then
    local friend = Unit:GetRandomFriend()
    pUnit:FullCastSpellOnTarget(25840,friend)
    end
    end
    
    
    function ChainHealHorde(pUnit, event)
    if pUnit:GetHealthPct() <= 50 then
    local friend = Unit:GetRandomFriend()
    pUnit:FullCastSpellOnTarget(25840,friend)
    end
    end
    
    
    function HordeShaman_OnLeaveCombat(pUnit, event)
    pUnit:RemoveEvents() 
    end
    
    function HordeShaman_OnKilledTarget(pUnit, event)
    pUnit:SendChatMessage(12, 0, "May the spirits forgive you")
    end
    
    function HordeShaman_OnDied(pUnit, event)
    pUnit:RemoveEvents() 
    end
    
    RegisterUnitEvent(24633, 1, "HordeShaman_OnCombat")
    RegisterUnitEvent(24633, 2, "HordeShaman_OnLeaveCombat")
    RegisterUnitEvent(24633, 3, "HordeShaman_OnKilledTarget")
    RegisterUnitEvent(24633, 4, "HordeShaman_OnDied")
    In my console I get the following error
    Code:
    Calling 'GetRandomFriend' on bad self (Unit expected, got table)
    2x+rep to anyone who solve this!
    Last edited by grothar1993; 04-17-2009 at 07:10 AM.

    Need some LUA help!
  2. #2
    saperior's Avatar Active Member
    Reputation
    58
    Join Date
    Feb 2008
    Posts
    136
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take out "local friend = Unit:GetRandomFriend()" replace it with.. "pUnit:GetRandomFreind()".

    Hope it helped
    Last edited by saperior; 04-18-2009 at 07:17 AM.

  3. #3
    eddiewom's Avatar Member
    Reputation
    1
    Join Date
    Feb 2008
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by saperior View Post
    Take out "local friend = Unit:GetRandomFriend()" replace it with.. "pUnit:GetRandomFreind()".

    Hope it helped

    Typo: pUnit:GetRandomFreind() needs to be pUnit:GetRandomFriend()

    =)

Similar Threads

  1. [Lua Script] Need some Lua help =P
    By tyeeeee1 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 07-21-2012, 01:35 PM
  2. Making an addon, need some LUA help
    By gryphons53 in forum WoW UI, Macros and Talent Specs
    Replies: 1
    Last Post: 12-30-2009, 02:39 AM
  3. I need some Lua help please. Great concept.
    By TripZone in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 08-01-2009, 02:01 PM
  4. I need some Lua help,
    By Kiev in forum WoW EMU Questions & Requests
    Replies: 11
    Last Post: 12-24-2008, 04:19 PM
  5. i need some lua help please
    By runiker in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 02-29-2008, 07:49 AM
All times are GMT -5. The time now is 01:48 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