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
[CODE]function PlayerPickup(ply, ent)
if ply:IsSuperAdmin() and ent:GetClass():lower() == "player" then
return true
end
end
hook.Add("PhysgunPickup", "Allow Player Pickup", PlayerPickup)[/CODE]
You might be able to use the [b]OnPhysgunFreeze[/b] hook. You could then just use [lua]ply:SetMoveType(MOVETYPE_NONE);[/lua] or similar to freeze the player.
[QUOTE=vexx21322;42082552]You might be able to use the [b]OnPhysgunFreeze[/b] hook. You could then just use [lua]ply:SetMoveType(MOVETYPE_NONE);[/lua] or similar to freeze the player.[/QUOTE]
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