• Player.Pickup Freezing On Admin RightClick
    9 replies, posted
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
[url]http://wiki.garrysmod.com/page/Beginner_Tutorial_Intro[/url] [url]http://wiki.garrysmod.com/page/Hook_Library_Usage[/url]
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?
Sorry, you need to Log In to post a reply to this thread.