lua code:-- Based off DarkstaR's 'Players Above', but shows all floors above and below. Shows how many floors above or below the player is.
local TextDisplayList = {HUD.CreateTextDisplay(25, 5, "Players Above & Below:", 255, 120, 120)}
Module.New("Track Players", function(Module)
local players = {}
for index = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(index)
if (creature:isValid() and creature:isPlayer()) then
local locz = Self.Position().z - creature:Position().z
local locy = math.abs(Self.Position().y - creature:Position().y)
local locx = math.abs(Self.Position().x - creature:Position().x)
if (locx <= 7 and locy <= 5 and locz ~= 0) then
local z = "" .. locz
if locz > 0 then
z = "+" .. z
end
players[#players+1] = ("[" .. z .. "]" .. creature:Name())
end
end
end
while (#TextDisplayList <= #players) do
TextDisplayList[#TextDisplayList+1] = HUD.CreateTextDisplay(25, 5 + (12 * (#TextDisplayList)), "", 255, 120, 120)
end
for i = 1, #TextDisplayList-1 do
if (i <= #players) then
TextDisplayList[i+1]:SetText(players[i])
else
TextDisplayList[i+1]:SetText("")
end
end
Module:Delay(500)
end)