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