ObjectName

Returns the name of a WowGameObject.

ObjectName(--[[(1)]]objectReference) : name | false
  1. See Object Reference for more information on possible values.

Example

Get the players name.

local name = ObjectName('player')

Do something with the names of all objects.

for i, object in ipairs(Objects()) do
local name = ObjectName(object)
-- do something with name
end