Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to make a player noclip? (Help with admin)

Asked by
Aztralzz 169
4 years ago

So I am making an admin script, and I am trying to figure out how to noclip a player. Can anyone help? Here's an example of a command:

Commands.kick = function(Sender,Arguments)
    local Argument = PartialMatch(Arguments[1]);
    if not Argument then return false end;
    Argument:Destroy()
end
0
yo are you gonna accept my answer zadobyte 692 — 4y

1 answer

Log in to vote
0
Answered by
zadobyte 692 Moderation Voter
4 years ago
Edited 4 years ago

You'd probably be interested in Collision Groups, they allow you to set what collides with what. You could use that to loop through the character parts and make it so that it cant interact with walls and whatever else you want.

local ps = game:GetService("PhysicsService")
ps:CreateCollisionGroup("Character")
ps:CreateCollisionGroup("Parts")
for i, v in ipairs(plr.Character) do
    if v:IsA("BasePart") or v:IsA("MeshPart") then
        ps:SetPartCollisionGroup(v, "Character")
    end
end
for i, v in ipairs(game.Workspace) do
    if v:IsA("Part") then
        ps:SetPartCollisionGroup(v, "Parts")
    end
end
ps:CollisionGroupSetCollidable("Character", "Parts", false/true)
Ad

Answer this question