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

help with my player no collide script [need one]?

Asked by
oofImao -10
5 years ago
script.Parent = game:GetService("ServerScriptService")
local PhysService = game:GetService("PhysicsService")
local PlayerGroup = PhysService:CreateCollsionGroup("p")
PhysService:CollisionGroupSetCollidable("p","p",false)

function NoCollide(model)
    for k,v in pairs(model:GetChildren()) do
        if v:isA"BasePart" then
            PhysService:SetPartCollisionGroup(v,"p")
        end
    end
end

game:GetService("Players").PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(char)
        char:WaitForChild("HumanoidRootPart")
        char:WaitForChild("Head")
        char:WaitForChild("Humanoid")
        wait(0.1)
        NoCollide(char)
    end)

    if player.Character then
        NoCollide(player.Character)
    end
end)
0
Make a variable for ServerScriptService instead of "script.Parent = game:GetService("ServerScriptService") as it's pointless. Also what's the problem you're having? Just saying help with it doesn't tell us what the problem is. MythicalShade 420 — 5y
0
Not sure what the question is asking hipenguinflip 30 — 5y

Answer this question