local PS = game:GetService("PhysicsService")
PS:CreateCollisionGroup("Player")
PS:CollisionGroupSetCollidable("Player","Player",false)
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
Character:WaitForChild("HumanoidRootPart")
Character:WaitForChild("Head")
Character:WaitForChild("Humanoid")
for i,v in pairs(Character:GetChildren()) do
if v:IsA("BasePart") then
PS:SetPartCollisionGroup(v,"Player")
end
end
end)
end)
This is my current script for and it does work when i play local but as soon as its a server it doesn’t work? Not sure why any help will be appreciated!
local PS = game:GetService("PhysicsService")
PS:CreateCollisionGroup("Player")
PS:CollisionGroupSetCollidable("Player","Player",false)
game.Players.PlayerAdded:Connect(function(Player)
for i,v in pairs(plr.Character:GetChildren()) do
if v:IsA("BasePart") then
PS:SetPartCollisionGroup(v,"Player")
end
end
Player.CharacterAppearanceLoaded:Connect(function(Character)
for i,v in pairs(Character:GetChildren()) do
if v:IsA("BasePart") then
PS:SetPartCollisionGroup(v,"Player")
end
end
end)
end)
Those do not have anything to do with the collision, Have you tried making a collision group beforehand then in the game all you need to do is set the collision groups to the players.
Also when you test, click on one of the player’s parts and check if the collision group is applied to them.
script.Parent = game:GetService("ServerScriptService")
local PhysService = game:GetService("PhysicsService")
local PlayerGroup = PhysService:CreateCollisionGroup("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.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)