!lr system troubles for jailbreak

I’m trying to make a last request for jailbreak, but this code doesn’t seem to give weapons to either the guard or the prisoner.

Though I’m struggling with this net stuff.

cl_init.lua
[lua]local function lastre()

...

local Button2 = Menu:Add( "DButton" )
Button2:SetSize( 150, 100 )
Button2:SetPos( 250, 50 )
Button2:SetFont( "F1font" )
Button2:SetText( "Knife Fight" )
Button2.Paint = function()
	draw.RoundedBox( 0, 0, 0, Button2:GetWide(), Button2:GetTall(), Color( 80, 80, 80, 255) )
	draw.RoundedBox( 0, 4, 4, Button2:GetWide() - 8, Button2:GetTall() - 8, Color( 225, 225, 225, 255 ) )
end
Button2.DoClick = function()
	local MenuButtonOptions = DermaMenu() -- Creates the menu
	for k,v in pairs(team.GetPlayers(2)) do
		if v:Alive() then
			 MenuButtonOptions:AddOption(v:Nick(), function()
			 net.Start("last")
			 net.WriteFloat(v:EntIndex())
			 net.SendToServer()
			 end)
		end
	end
	MenuButtonOptions:Open() -- Open the menu AFTER adding your options
end

...

end
usermessage.Hook(“lastre”, lastre)[/lua]

init.lua
[lua]util.AddNetworkString( “last” )
net.Receive( “last”, function()
ply1 = player.GetByID(net.ReadFloat())
ply1:ChatPrint(“test”)
ply1:StripWeapons()
ply1:Give(“weapon_deagle”)
end)[/lua]

In your init.lua, you’re only adding the network string for “last”, but you’re using “lastre” ?

Do you have it defined elsewhere?

Sorry, updated the OP.

It strips the guard but not the prisoner and doesn’t give any weapons at all.

Bumping. Can someone help please?

Any help?

Why don’t you use WriteEnt instead of writing a float of an entity index? PS. Entity Indexes are a UInt not a Float.

WriteEnt does exactly that.