TTT Scoreboard Right Click Menu Help

I recently dug up some old code on my PC from my old server which I never really used due to a glitch. The code opens a drop down menu where staff can trigger commands on the certain names of players, but the glitch happens where if you right clicked on any of the names to open up the menu the drop down menu would appear at the top left of the screen and not at the cursor, I am a pretty novice coder who can just fix blatant problems so this is well and truly above my pay grade.
Also, I place this snippet of code in the sb_rows.lua file but it’d be nice to make it work as an addon, would be nice but it’s not an issue.

[lua]function PANEL:DoRightClick()
local ply = self.Player

	if ply:IsUserGroup("owner") or ply:IsUserGroup("admin") or ply:IsUserGroup("mod")  then
	surface.PlaySound("buttons/button9.wav")
		local options = DermaMenu()
		options:AddOption("Open Profile", function() ply:ShowProfile() surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/information.png")
		options:AddOption("Copy Name", function() SetClipboardText(ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tag_blue.png")
		options:AddOption("Copy SteamID", function() SetClipboardText(ply:SteamID()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tag_blue.png")
		options:AddSpacer()
		options:AddOption("Mute", function() RunConsoleCommand("ulx","mute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/comment.png")
		options:AddOption("Unmute", function() RunConsoleCommand("ulx","unmute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/comment_delete.png")
		options:AddOption("Gag", function() RunConsoleCommand("ulx","gag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/sound_delete.png")
		options:AddOption("Ungag", function() RunConsoleCommand("ulx","ungag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/sound.png")
		options:AddOption("Force Spectate", function() RunConsoleCommand("ulx","fspec",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/zoom.png")
		options:AddOption("Un-Spectate", function() RunConsoleCommand("ulx","unspec",ply:Nick(),"You were kicked") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/zoom.png")			
		options:AddOption("Kick", function() RunConsoleCommand("ulx","kick",ply:Nick(),"You were kicked") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/door_out.png")			
		options:AddSpacer()
		options:AddOption("Slay Now", function() RunConsoleCommand("ulx","slay",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cross.png")
		options:AddOption("Slay Next Round", function() RunConsoleCommand("ulx","slaynr",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cross.png")
		options:AddOption("Remove Slay Next Round", function() RunConsoleCommand("ulx","rslaynr",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tick.png")	
		options:AddSpacer()
		options:AddOption("Go To", function() RunConsoleCommand("ulx","goto",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/arrow_right.png")				
		options:AddOption("Bring", function() RunConsoleCommand("ulx","bring",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/arrow_left.png")						
	end

end
[/lua]


function PANEL:DoRightClick()
		local ply = self.Player
	
		if ply:IsUserGroup("owner") or ply:IsUserGroup("admin") or ply:IsUserGroup("mod")  then
		surface.PlaySound("buttons/button9.wav")
			local options = DermaMenu()
			options:AddOption("Open Profile", function() ply:ShowProfile() surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/information.png")
			options:AddOption("Copy Name", function() SetClipboardText(ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tag_blue.png")
			options:AddOption("Copy SteamID", function() SetClipboardText(ply:SteamID()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tag_blue.png")
			options:AddSpacer()
			options:AddOption("Mute", function() RunConsoleCommand("ulx","mute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/comment.png")
			options:AddOption("Unmute", function() RunConsoleCommand("ulx","unmute",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/comment_delete.png")
			options:AddOption("Gag", function() RunConsoleCommand("ulx","gag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/sound_delete.png")
			options:AddOption("Ungag", function() RunConsoleCommand("ulx","ungag",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/sound.png")
			options:AddOption("Force Spectate", function() RunConsoleCommand("ulx","fspec",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/zoom.png")
			options:AddOption("Un-Spectate", function() RunConsoleCommand("ulx","unspec",ply:Nick(),"You were kicked") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/zoom.png")			
			options:AddOption("Kick", function() RunConsoleCommand("ulx","kick",ply:Nick(),"You were kicked") surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/door_out.png")			
			options:AddSpacer()
			options:AddOption("Slay Now", function() RunConsoleCommand("ulx","slay",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cross.png")
			options:AddOption("Slay Next Round", function() RunConsoleCommand("ulx","slaynr",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/cross.png")
			options:AddOption("Remove Slay Next Round", function() RunConsoleCommand("ulx","rslaynr",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/tick.png")	
			options:AddSpacer()
			options:AddOption("Go To", function() RunConsoleCommand("ulx","goto",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/arrow_right.png")				
			options:AddOption("Bring", function() RunConsoleCommand("ulx","bring",ply:Nick()) surface.PlaySound("buttons/button9.wav") end):SetImage("icon16/arrow_left.png")	
options:Open()					
		end
end

Cheers, you’ve really helped me out.