Making a ULX command to open a player's profile, encountering some issues with defining variables for the client

Ok so I have this

[LUA]function ulx.profile( calling_ply, target_plys )
local affected_plys = {}

for i=1, #target_plys do
	for _, v in ipairs( target_plys ) do
		local comID = v:SteamID64()
	calling_ply:gui.OpenURL(string.format("", comID))


ulx.fancyLogAdmin( calling_ply, "#A opened #T's profile ", affected_plys )


local profile = ulx.command( CATEGORY_NAME, “ulx profile”, ulx.profile, “!profile” )
profile:addParam{ type=ULib.cmds.PlayersArg }
profile:defaultAccess( ULib.ACCESS_ALL )
profile:help( “Opens target’s profile” ) [/LUA]

It opens because it returns comID as a nil value. This seems to be because its not defined for the client. How can I get my variable to be usable for the client and still update to the targeted player’s id when I use the command?

You’d only want it targeting one player.
Try this.

function ulx.profile( calling_ply, target_ply )
    ulx.fancyLogAdmin( calling_ply, "#A opened the profile of #T", target_ply )
local profile = ulx.command( CATEGORY_NAME, "ulx profile", ulx.profile, "!profile" )
profile:addParam{ type=ULib.cmds.PlayerArg }
profile:defaultAccess( ULib.ACCESS_ALL )
profile:help( "Opens target's profile" )

Also I would suggest removing the log, it’s pointless and will just get spammed.

I’ll be honest, I wasn’t expecting that to work but I just changed it to [lua]calling_ply:SendLua(“gui.OpenURL('”… target_ply:SteamID64() …"’)")[/lua] and it worked perfect. Thanks a ton!