Best way to send UniqueID clientside?

So I need to use the UniqueID when I call up a vgui, but I am not sure what the best way to do this is, so far I have:

[lua]datastream.Hook( “RE”,

function( pl, playerID )
	local RE = vgui.Create("RE")
	local list = file.Find("RE/stuff/"..playerID.."/*.txt")
	for _, f in pairs(list) do
		print(playerID.." "..f)



local playerID = pl:UniqueID()
datastream.StreamToClients(pl, “RE”, playerID)

But the playerID turns into the number 1 as soon as I stream it, I am guessing it is not even possible this way?

Thanks in advance :slight_smile:

You’re simply specifying the wrong arguments, it goes like this :

function IncomingHook( pl, handler, id, encoded, decoded )

so playerID should be the 5th argument.

Also before you get flamed I’ll just suggest you use user-messages for sending something as simple/small.

Useful links :

Sweet using user-messages worked perfectly, thank you!