cl_scoreboard custom commands

Hey. I have a problem with my server when trying to create custom Commands. The basic ones work such as force spectate which comes with the Murder gamemode.

Here is my custom one


			local force = actions:AddOption( "Slay" )
			force:SetIcon( "icon16/delete.png" )
			function force:DoClick()
				RunConsoleCommand("ulx", "slay", ply:EntIndex())
			end

The option shows up in the TAB Player menu but when I click the option it does not work and i get the following error message: Command “ulx slay”, argument #1: no targets found

Can anyone help me with this?

You’re sending in an entity index: that’s an integer. Send in their name or SteamID or whatever reliable method that command supports.

Instead of ply:EntIndex() use this:

[lua]
“$” … ply:UserID()
[/lua]

The $ tells ulx you’re sending an UserID and not a name

tyvm, this helped.