Paulix
Active Member
- Joined
- Sep 13, 2012
- Messages
- 129
- Solutions
- 7
- Reaction score
- 26
I'm trying to print all monster info on my console, so I know how to use it to make my script. I've been making this but looks like there is a lot of tables inside other tables and I can't figure how to make print it all. Here is how I was trying...
and this is the output
how can I manage to print every single table inside all tables on my monster info?
Lua:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Monster name required.")
return true
end
monster = getMonsterInfo(param)
for k,v in pairs(monster) do
if type(v) == "table" then
print(k..": "..tostring(v))
for l,x in pairs(v) do
print(" "..l..": "..tostring(x))
end
else
print(k..": "..tostring(v))
end
end
return true
end
and this is the output
Code:
[30/3/2018 8:7:48] description: a dark demon
[30/3/2018 8:7:48] skull: 0
[30/3/2018 8:7:48] healthMax: 6400
[30/3/2018 8:7:48] hostile: true
[30/3/2018 8:7:48] armor: 40
[30/3/2018 8:7:48] illusionable: false
[30/3/2018 8:7:48] outfit: table: 139D49A8
[30/3/2018 8:7:48] lookAddons: 0
[30/3/2018 8:7:48] lookType: 12
[30/3/2018 8:7:48] lookHead: 0
[30/3/2018 8:7:48] lookTypeEx: 0
[30/3/2018 8:7:49] lookLegs: 87
[30/3/2018 8:7:49] lookBody: 95
[30/3/2018 8:7:49] lookFeet: 113
[30/3/2018 8:7:49] summons: table: 139D09E8
[30/3/2018 8:7:49] loot: table: 139D9C00
[30/3/2018 8:7:49] 1: table: 139DB230
[30/3/2018 8:7:49] 2: table: 139D4EF8
[30/3/2018 8:7:49] 3: table: 139D1910
[30/3/2018 8:7:49] 4: table: 139D5858
[30/3/2018 8:7:49] 5: table: 139D3AD0
[30/3/2018 8:7:49] 6: table: 139D8698
[30/3/2018 8:7:49] 7: table: 139D6758
[30/3/2018 8:7:49] 8: table: 139DF358
[30/3/2018 8:7:49] 9: table: 139D4F20
[30/3/2018 8:7:49] 10: table: 139D2158
[30/3/2018 8:7:49] summonable: false
[30/3/2018 8:7:49] lookCorpse: 6068
[30/3/2018 8:7:49] attacks: table: 139DF7E0
[30/3/2018 8:7:49] 1: table: 139DB0A0
[30/3/2018 8:7:49] 2: table: 139DA088
[30/3/2018 8:7:49] 3: table: 139D9DB8
[30/3/2018 8:7:49] 4: table: 139DBAF0
[30/3/2018 8:7:49] defense: 48
[30/3/2018 8:7:49] attackable: true
[30/3/2018 8:7:49] guildEmblem: 0
[30/3/2018 8:7:49] race: 2
[30/3/2018 8:7:49] defenses: table: 139D6988
[30/3/2018 8:7:49] 1: table: 139D2D10
[30/3/2018 8:7:49] baseSpeed: 275
[30/3/2018 8:7:49] name: Dark Demon
[30/3/2018 8:7:49] partyShield: 0
[30/3/2018 8:7:49] convinceable: false
[30/3/2018 8:7:49] manaCost: 0
[30/3/2018 8:7:49] experience: 5323
[30/3/2018 8:7:49] health: 6400
how can I manage to print every single table inside all tables on my monster info?