Nutscript commands for ULX?

I have been working on ULX commands for nutscript. I used to just have the ulx command route through chat. Now I’m working on making it work with RCON. Here is what I have, but it is not seeming to work.

local flags = {

function ulx.flaggive(client, arguments)
		local target = nut.command.findPlayer(client, arguments[1])

		if (IsValid(target) and target:getChar()) then
			local flags = arguments[2]

			if (!flags) then
				local available = ""

				for k, v in SortedPairs(nut.flag.list) do
					if (!target:getChar():hasFlags(k)) then
						available = available..k

				return client:requestString("@flagGiveTitle", "@flagGiveDesc", function(text), "flaggive", {target:Name(), text})
				end, available)


			nut.util.notifyLocalized("flagGive", nil, client:Name(), target:Name(), flags)
local flaggive = ulx.command("Test Commands", "ulx flaggive", ulx.flaggive, "!flaggive",true)
flaggive:addParam{ type=ULib.cmds.PlayerArg }
flaggive:addParam{ type=ULib.cmds.StringArg, hint="flags", completes=flags, ULib.cmds.optional }
flaggive:defaultAccess( ULib.ACCESS_ADMIN )
flaggive:help( "Assigns the selected flags for a player." )

[editline]8th April 2016[/editline]

I’m not 100% sure if this is the correct place to post this.