Hi, I have a quick question…
I know, I can search for it in YouTube but DevForum is better for me.
I just want to know how to make other players can’t collide with you in game, I’m trying to do script but it’s similar to this
--local script
game.Players.PlayerAdded:Connect(function(p)
local players = game.Players:GetChildren()
for i, v in pairs() do
--etc
end
end)
Well basically you loop through the characters body parts and add each one to a collision group which that collision group cant collide with other things in that collision group, here is a example of how I did it.
local physicsService = game:GetService("PhysicsService")
physicsService:CollisionGroupSetCollidable("Players", "Players", false) -- makes it so players cant collide with players
local function noCollide(character)
for _, part in pairs(character:GetChildren()) do
if part:IsA("BasePart") then
physicsService:SetPartCollisionGroup(part, "Players")
end
end
end
players.PlayerAdded:Connect(function(player)
local character = player.Character or player.CharacterAdded:Wait()
character:WaitForChild("HumanoidRootPart")
character:WaitForChild("Head")
character:WaitForChild("Humanoid")
noCollide(character)
end)