• Morbus Quick Lua Help.
    2 replies, posted
So, we all know that the default damage logs in Morbus are, well, shit. I tried working on a ULX module to make it easier to check/print damage logs. So, tried effortlessly all day to get this fucker to work. I've tried different codes and all of the shits, but it throws errors at me when I use the command. Here's the code I'm trying to use: [QUOTE='Divize']Code: function ulx.damagelog(player, attacker,hp,hurt) local aname = attacker:GetName() local pname = player:GetName() if player.attacker.hurt = "" then player.attacker = aname.. "did ".. hurt .. " dammage to ".. pname .."x" end local damagelog = ulx.command( CATEGORY_NAME, "ulx damagelog", ulx.damagelog, "!dlog" ) Hook.Add("PlayerHurt","damagelog" ,damagelog) damagelog:addParam{ type=ULib.cmds.PlayersArg } damagelog:defaultAccess( ULib.ACCESS_MODERATOR ) damagelog:help( "Checks the damage logs." ) [/QUOTE] Which then throws this error upon using the command: [QUOTE='Divize'] Code: [ERROR] lua/autorun/client/admin.lua:4: attempt to call global 'GetPrintFn' (a nil value) 1. unknown - lua/autorun/client/admin.lua:4 2. unknown - lua/includes/modules/concommand.lua:69 [/quote] Edit: I did a clean install of ULX, and now it's giving me the following error: [QUOTE='Divize'] Code: [ERROR] addons/ulx/lua/ulx/modules/sh/morbus.lua:7: 'then' expected near '=' 1. unknown - addons/ulx/lua/ulx/modules/sh/morbus.lua:0 [/quote] Seems like a simple fix, right? But not really, because if I just delete that line, it then tells me the same error for the new Line 7, i.e. line 8. It doesn't look wrong to me, but I suck balls at lua shit. Can someone please help me and tell me what's wrong and what should I modify please? Thanks alot, Divize.
if player.attacker.hurt = "" then should be if player.attacker.hurt == "" then
Thanks alot, Ice Tea :wink:
Sorry, you need to Log In to post a reply to this thread.