Player.Pickup Freezing On Admin RightClick

How could i make it that when i pick up a player and i want to freeze them and unfreeze them with the physgun? What code would i add to


function PlayerPickup(ply, ent)
	if ply:IsSuperAdmin() and ent:GetClass():lower() == "player" then
		return true
	end
end
 
hook.Add("PhysgunPickup", "Allow Player Pickup", PlayerPickup)

You might be able to use the OnPhysgunFreeze hook. You could then just use [lua]ply:SetMoveType(MOVETYPE_NONE);[/lua] or similar to freeze the player.

Where would i put ply:SetMoveType(MOVETYPE_NONE);

[editline]5th September 2013[/editline]

I cant seem to get this to work?

Bump

[lua]
hook.Add(“OnPhysgunFreeze”, “PlayerFreezing”, function(weapon, physobj, ent, ply)
if ent:IsPlayer() then
ent:Freeze( true )
ent:SetMoveType(MOVETYPE_NONE)
end
end)
[/lua]

Okay I am sorry, I am sorta new to this… where do I add this?
Cheers

Lua/autorun/server

I think i tried it before but didnt work on playrs

I would need to be running the script on the server that I own?