Hello,
I want to remove collisions between players in my game. I had a script a few years ago but apparently they changed collisions group last year: Updates to Collision Groups
I changed a few things about my code but I can’t figure out something:
I have this error when I join the game
Here is my code:
script.Parent = game:GetService("ServerScriptService")
local PhysService = game:GetService("PhysicsService")
local PlayerGroup = PhysService:RegisterCollisionGroup("p")
PhysService:CollisionGroupSetCollidable("p","p",false)
function NoCollide(model)
for k,v in pairs (model:GetChildren()) do
if v:IsA"BasePart" then
v.CollisionGroup(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)
if player.Character then
NoCollide(player.Character)
end
end)
end)
Please help