• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Get names of all creatures from tile

klepacz

New Member
Joined
Aug 12, 2015
Messages
35
Reaction score
0
I've tried this:
Code:
local tile = Tile(pos)
local tileCreatures = tile:getCreatures()
--print(tileCreatures)
if tileCreatures then
for i = 1, #tileCreatures do
      local creature = Creature(tileCreatures)
      print(creature:getName())
  end
end

But creature:getName() is nil.
print(tileCreatures) returns table when someone is standing on that tile, so the only problem is to get names from this table one by one
 
I've tried this:
Code:
local tile = Tile(pos)
local tileCreatures = tile:getCreatures()
--print(tileCreatures)
if tileCreatures then
for i = 1, #tileCreatures do
      local creature = Creature(tileCreatures)
      print(creature:getName())
  end
end

But creature:getName() is nil.
print(tileCreatures) returns table when someone is standing on that tile, so the only problem is to get names from this table one by one
Change:
local creature = Creature(tileCreatures)

To:

Code:
      local creature = tileCreatures[i]
 
Back
Top