I need help converting a standard lua command, to a ulx command

I have tired myself, but I am not good enough with lua yet. It’s a command for TTT that will set the targets karma to whatever the admin specifies… It works fine, but it is a bit of a hassle to do it in console every time. Here’s the code I would like to implement in ulx.

concommand.Add(“ttt_setkarma”, function(client, command, arguments)
if ( IsValid(client) and client:IsAdmin() ) then
if (!arguments[1]) then
client:ChatPrint(“Missing name!”);

        return;
    elseif (!arguments[2]) then
        client:ChatPrint("Missing amount!");

        return;
    end;

    local name = string.lower(arguments[1]);
    local amount = tonumber(arguments[2]) or 1000;

    for k, v in pairs( player.GetAll() ) do
        if ( string.find(string.lower( v:Name() ), name) ) then
            v:SetLiveKarma(amount);
            v:SetBaseKarma(amount);
        end;
    end;
end;

end);

Thanks in advance :slight_smile:

Do it yourself, you’ll learn more about lua that way, just look at files from ulx\lua\ulx\modules\sh

I have tried, I wouldn’t ask for help if I hadn’t tried :C