[Beta Testing] My script. menu

User Tag List

Results 1 to 4 of 4
  1. #1
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Beta Testing] My script.

    Im making a LUA script. And i'd like some people to test it and if there are any errors report them or just correct them.

    The script is to a pvp pet.

    local pet = 91337

    function Intro(Unit, Event)
    if pet:IsCreature() == true then
    pet:RegisterEvent("Follow", 100, 0)
    else
    end
    end

    function Follow(Unit, Event)
    local plr = pet:GetClosestPlayer()
    x = plr:GetX()
    y = plr:GetY()
    z = plr:GetZ()
    o = plr:GetO()
    x = x - 5
    pet:MoveTo(x,y,z,o)
    RegisterUnitEvent(Follow2, 1000, 0)
    end

    function Follow2(Unit, Event)
    local plr = pet:GetClosestPlayer()
    x = plr:GetX()
    y = plr:GetY()
    z = plr:GetZ()
    o = plr:GetO()
    x = x - 5
    pet:MoveTo(x,y,z,o)
    RegisterUnitEvent(Follow, 1000, 0)
    end

    RegisterUnitEvent(1, "PetCombat")

    function PetCombat(pUnit, Event)
    if pet:GetHealthPct() >99 then
    pet:SendChatMessage(14, 0, "Finally some action!")
    Choice=math.random(1, 3)
    if Choice==1 then
    pet:FullCastSpellOnTarget(42917, pUnit:GetNearestPlayer())
    end
    if Choice==2 then
    pet:FullCastSpellOnTarget(6215, pUnit:GetNearestPlayer())
    end
    end
    end
    end

    function pet_onleavecombat(Unit, Event)
    pet = Unit
    pet:RemoveEvents()
    pet:RegisterEvent("Follow", 100, 0)
    end
    Last edited by P1raten; 08-05-2009 at 03:22 PM.

    [Beta Testing] My script.
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    function Intro(Unit, Event)
    pet:IsCreature()

    is the first error I see.
    You havn't ended it.
    Thats not the syntax, should be something like

    if pet:IsCreature() == true then
    else
    end

    And you can't use a number something you use, for example
    91337:MoveTo() What is this? The script doesn't know. When you say in a function pet = Unit or whatever it will get the guid of the npc which is it uniquely.

  3. #3
    P1raten's Avatar Banned
    Reputation
    500
    Join Date
    Mar 2008
    Posts
    1,323
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx, updated.

  4. #4
    Dibes's Avatar Active Member
    Reputation
    18
    Join Date
    May 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i still see an error...

    function Intro(Unit, Event)
    pet:IsCreature()
    that is an incomplete function, it is just seeing if the pet is a creature then it doesnt know what to do, so you need it to look something like this

    function Intro(Unit, Event)
    if pet:IsCreature() == true then
    pet:RegisterEvent("Follow", 100, 0)
    else
    end
    end
    on to the next issue i see.

    pet:MoveTo(x,y,z,o)
    RegisterUnitEvent(Follow, 1000)
    end
    You need to change
    RegisterUnitEvent(Follow, 1000)
    to
    pet:RegisterEvent(Follow, 1000, 0)
    do the same with follow 2

    then to make it loop back to following you i would make another function.

    function pet_onleavecombat(Unit, Event)
    pet = Unit
    pet:RemoveEvents()
    pet:RegisterEvent("Follow", 100, 0)
    end
    then register that as on leave combat.

    then it should work nice and fine!!!
    Last edited by Dibes; 07-23-2009 at 12:48 PM.

Similar Threads

  1. [Beta Test] Raven's ADT Editor
    By Ravenheart in forum World of Warcraft Model Editing
    Replies: 23
    Last Post: 05-15-2009, 12:06 PM
  2. Replies: 0
    Last Post: 01-22-2008, 08:05 PM
All times are GMT -5. The time now is 05:54 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