• Physgun through walls as admin help.
    5 replies, posted
So i need a little help: I have a darkrp server where i want our admins to physgun players through props and world like if they where in noclip with a dog leash. All i ahve tried is some hooks with physgunpickup and drop, and some setcollisiongroup, but that dosen't seem to work. Please help tomilo
Try using ply:SetMoveType(MOVE_NOCLIP) while they're being grabbed. You can also ply:Freeze(true) them while they're grabbed to prevent them from flying around.
Thanks for the post btw, but i have already tried that. Sorry by not mentioning ;)
Share the code you have tried, and maybe there is some fault with it we can help you fix.
local function PlayerPickup( ply, ent ) if ( ply:IsAdmin() and ent:GetClass():lower() == "player" ) then ent:SetCollisionGroup(COLLISION_GROUP_IN_VEHICLE) end end hook.Add( "PhysgunPickup", "NoCollideThroughEverything", PlayerPickup ) local function PlayerDrop ( ply, ent ) if( ply:IsAdmin() and ent:GetClass():lower() == "player") then ent:SetCollisionGroup(COLLISION_GROUP_NONE) end end hook.Add( "PhysgunDrop", "CollideWithEverything", PlayerDrop ) and local function PlayerPickup( ply, ent ) if ( ply:IsAdmin() and ent:GetClass():lower() == "player" ) then ent:SetMoveType(MOVETYPE_NOCLIP) end end hook.Add( "PhysgunPickup", "NoCollideThroughEverything", PlayerPickup ) local function PlayerDrop ( ply, ent ) if( ply:IsAdmin() and ent:GetClass():lower() == "player") then ent:SetMoveType(MOVETYPE_WALK) end end hook.Add( "PhysgunDrop", "CollideWithEverything", PlayerDrop )
local allowed = { "superadmin", "administator", "trustedmod", "moderator", } local function PlayerPickup( ply, ent ) if ( table.HasValue(allowed, ply:GetUserGroup()) and ent:IsPlayer()) then ent:SetMoveType(8) end end hook.Add( "PhysgunPickup", "NoCollideThroughEverything", PlayerPickup ) local function PlayerDrop ( ply, ent ) if( table.HasValue(allowed, ply:GetUserGroup()) and ent:IsPlayer()) then ent:SetMoveType(2) end end hook.Add( "PhysgunDrop", "CollideWithEverything", PlayerDrop ) This one is the latest one, but something isn't working
Sorry, you need to Log In to post a reply to this thread.