ULX target player

What I would like to do is make the script that I have made target a specific player so instead of bringing it up on my screen, bring it up on someone elses.
The script is
[lua]CATEGORY_NAME = “Site Links”

function ulx.d4nny(ply)
ply:SendLua([[
HTMLTest = vgui.Create(“HTML”)
HTMLTest:SetPos(50,50)
HTMLTest:SetSize(ScrW() - 100, ScrH() - 100)
HTMLTest:OpenURL(“http://www.garrysmod.com”)
timer.Simple( 10, function() HTMLTest:Remove() end )
]])
end
local d4nny = ulx.command( CATEGORY_NAME, “ulx d4nny”, ulx.d4nny, “!d4nny” )
d4nny:defaultAccess( ULib.ACCESS_SUPERADMIN )
d4nny:help( “Torture an innocent soul!” )[/lua] The script works flawlessly without errors as far as I know. The code may be bad since I am a very amateur coder :stuck_out_tongue: Thank in advance for any help! :slight_smile:

I could be wrong, as I haven’t thought this out to much but maybe:

EDIT2: Fixed. Tested and works!


function ulx.d4nny(ply, target_plys)

for i=1, #target_plys do
			local v = target_plys[ i ]
    	    v:SendLua([[
HTMLTest = vgui.Create("HTML")
HTMLTest:SetPos(50,50)
HTMLTest:SetSize(ScrW() - 100, ScrH() - 100)
HTMLTest:OpenURL("http://www.garrysmod.com")
timer.Simple( 10, function() HTMLTest:Remove() end  )
]])
end
end

local d4nny = ulx.command( CATEGORY_NAME, "ulx d4nny", ulx.d4nny, "!d4nny" )
d4nny:addParam{ type=ULib.cmds.PlayersArg }
d4nny:addParam{ type=ULib.cmds.BoolArg, invisible=true }
d4nny:defaultAccess( ULib.ACCESS_SUPERADMIN )
d4nny:help( "Torture an innocent soul!" )

Edit: 2Days Later: Uhh your welcome -_-

Sorry for not being able to reply, Exams all of this week. Thank you though.