Help quickly please

What is wrong with this?

My error I get is when I type the command print_damagelog:

Please help fix it!

Variable player is not what you think it is. Replace damagelog1 in the function arguments to player.

That is some ugly code and there’s not enough for me to be certain this will work, but try changing “function printthelog(damagelog1)” to “function printthelog(player)”

Edit: Damn, robotboy beat me to it.

How would I make actual work damage logs? Its harder than I thought! Thanks for help anyway

If you’re asking how to actually make a log of all damage done you would have to change your damangelog function to create the damagelog1 string and then append it to a file.

Printing the log might be a little more tricky. You probably wouldn’t want to print the whole log at once and i’m not sure if theres a tail function in lua. A workaround would be to insert the damagelog1 string into a table and put that table into a file. That way, when you read it you could have it loop through the last like 10 entries in the table and print only those.