Player:KeyDown question: A popup on ANOTHER player's screen while my key is pressed down...

Couldn’t find this…but here is what I have…
Serverside


 
util.AddNetworkString("request_popup")
util.AddNetworkString("dispatch_popup")

	net.Receive("request_popup", function(len, ply)
		local t = {}
		for k, v in pairs(player.GetAll()) do
			if v != ply then table.insert(t, v) end
		end

		net.Start("dispatch_popup")
		net.Send(t)
	end)

Clientside


function ShowBoard()
		
				local frame = vgui.Create("DFrame")
			
					
					frame:SetPos( 100, 100 )
					frame:SetSize( 100,100 )
					frame:SetVisible(true)
					frame:ShowCloseButton(true)
					frame:Center()
					frame:SetTitle("Quick Reference")
					frame:SetMouseInputEnabled(false) // REMOVE THIS LINE BEFORE FINISHING (or experiment with when wearing RIFT)
					frame:SetDraggable(true)
					print ("frame test")
					 gui.EnableScreenClicker( true ) // remove this line too


		end			

function requestpop()
net.Start("request_popup")
net.SendToServer()
end

net.Receive("dispatch_popup",function ()
print ("the correct player received it? ")
ShowCommandBoard()



end)

You can tell I’m still not sure about how to create this frame or image… but I have no idea how to turn this loop into a popup that will close if I let go if the key?

Well right now you don’t have a function to run on “request_popup”, and it doesn’t contain any data. If you want it to pop up on a specific player’s screen then you should use WriteEntity with the player you want to send it to.

In the “request_popup”'s receive function you should send “dispatch_popup” to the player who you want the popup to appear on.

Something like this:
[lua]
hook.Add( “Think”, “GlobalScore”, function()
for k,v in pairs( player.GetAll() ) do
if v:KeyDown( IN_FORWAD ) then
if not v.pressedOnce then
net.Start( “OpenScores” )
net.SendOmit( v )
v.pressedOnce = true
end
elseif v.pressedOnce then
net.Start( “CloseScores” )
net.SendOmit( v )
v.pressedOnce = false
end
end
end )
[/lua]