undead mage
Active Member
So I keep getting this error but I just can't figure out why I'm getting it.
This is my config:
This is my code:
Code:
attempt to get length of field 'playerPos' (a nil value) stack traceback:
[C]: in function '__len'
This is my config:
Code:
hohConfig = {
[48901] = { -- Movement ActionID
requiredLevel = 175, -- Minimum level to enter the boss
playerPos = {
Position(165, 532, 11),
Position(165, 533, 11),
Position(165, 534, 11),
Position(165, 535, 11),
Position(165, 536, 11)
},
playerNewPos = Position(173, 513, 11),
bossPos = Position(175, 508, 11) -- Where the boss will spawn
}
This is my code:
Code:
local storePlayers, playerTile = {}
for i = 1, #hohConfig.playerPos do
playerTile = Tile(hohConfig.playerPos[i]):getTopCreature()
if playerTile:getLevel() < hohConfig.requiredLevel then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. hohConfig.requiredLevel .." or higher.")
return true
end
storePlayers[#storePlayers + 1] = playerTile
end