Lua help menu

User Tag List

Thread: Lua help

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

    Lua help

    Hey I'm trying to script a boss and I'm trying to make the boss spawn a NPC exactly on whoever is fighting the boss, (like Prince Keleseth's Frost Tombs)
    but I can't figure out how to make the boss get the coords of the player (the player who is fighting the boss).

    Does anyone know how to make the boss get the player's coords?

    Thanks for the help

    Lua help
  2. #2
    Kiev's Avatar Contributor
    Reputation
    288
    Join Date
    Nov 2007
    Posts
    1,819
    Thanks G/R
    0/4
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something like:

    z = plr:CurrentLocationZ()
    x = plr:CurrentLocationX()

    It would be something like that. Not saying that works.




  3. #3
    Trle94's Avatar Contributor
    Reputation
    167
    Join Date
    May 2009
    Posts
    329
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it is like that but if he want to boss spawn NPC why would he need player coords he need Boss cord.. so it should be like this: Unit:GetX(),Unit:GetY(),Unit:GetZ(),Unit:GetO()


  4. #4
    Kiev's Avatar Contributor
    Reputation
    288
    Join Date
    Nov 2007
    Posts
    1,819
    Thanks G/R
    0/4
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read it again Trle:

    "Hey I'm trying to script a boss and I'm trying to make the boss spawn a NPC exactly on whoever is fighting the boss, (like Prince Keleseth's Frost Tombs)"




  5. #5
    Trle94's Avatar Contributor
    Reputation
    167
    Join Date
    May 2009
    Posts
    329
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    then player:GetO() etc ..


  6. #6
    Dr. Livingstone's Avatar Member
    Reputation
    113
    Join Date
    Mar 2008
    Posts
    290
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    local target = pUnit:GetRandomPlayer(0)
    local X = target:GetX()
    local Y = target:GetY()
    local Z = target:GetZ()
    local O = target:GetO()
    pUnit:SpawnCreature(NPCIDHERE, X + 3, Y - 3, Z + 3, O, 1720, 35000)
    That should do it for you. That will only select a random player though.

  7. #7
    darkwiz787's Avatar Member
    Reputation
    35
    Join Date
    Mar 2009
    Posts
    250
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Depends...
    Code:
    TABLE = {}
    TABLE.x = {}
    TABLE.y = {}
    TABLE.z = {}
    
    function TABLE.NPC_Something(Unit, pMisc, Event) -- Use the "pMisc" argument to get the player causing the event. E.G. in an OnCombat evert player is the person who initiated the combat. Player = pMisc
    Player = pMisc
    local x = Player:GetX() 
    local y = Player:GeyY 
    local z = Player:GetZ() 
    TABLE[tostring(Player)].x = x +3
    TABLE[tostring(Player)].y = y - 3
    TABLE[tostring(Player)].z = z
    --
    Unit:SpawnCreature(NPCIDHERE, TABLE[tostring(Player)].x, TABLE[tostring(Player)].y, TABLE[tostring(Player)].z, 0, 1720, 35000)
    end
    That will spawn it on the player who initiated the event...
    This will spawn it on a random player...


    Code:
    TABLE = {}
    TABLE.randomperson = {} 
    TABLE.randomperson.x = {} 
    TABLE.randomperson.y = {}
    TABLE.randomperson.z = {}  
    
    function TABLE.NPC_Something(Unit, Event, Player)
    local Target = Unit:GetRandomTarget() -- Can be changed to get a different target like main tank ;)
    local Targetx = Target:GetX()
    local Targety = Target:GetY()
    local Targetz = Target:GetZ()
    TABLE[tostring(Player)].randomperson.x = Targetx + 3
    TABLE[tostring(Player)].randomperson.y = Targety - 3
    TABLE[tostring(Player)].randomperson.z = Targetz
    --
    Unit:SpawnCreature(NPCIDHERE, TABLE[tostring(Player)].randomperson.x, TABLE[tostring(Player)].randomperson.y, TABLE[tostring(Player)].randomperson.z = Targetz, 0, 1720, 35000)
    end

Similar Threads

  1. [Help] Need LUA help? Post here!
    By EcHoEs in forum World of Warcraft Emulator Servers
    Replies: 20
    Last Post: 10-03-2010, 01:18 PM
  2. [Help] i need Lua help with this script...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 25
    Last Post: 03-03-2008, 03:45 PM
  3. LUA help
    By stoneharry in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 02-25-2008, 03:27 PM
  4. Lua help
    By reconz in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-18-2008, 07:03 PM
  5. Lua help
    By Tom_2001 in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 02-04-2008, 12:17 PM
All times are GMT -5. The time now is 01:56 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