Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i make players no CanCollide?

How can i make players no CanCollide????

2 answers

Hello nikoladzon! Insert a Script at WorkSpace and place this:

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)

I hope that helps you. Good luck.

5 comments

0

I just instantly detected the fact that you copied that from either ToolBox or somewhere else while telling nikoladzon to place the script in the Workspace.

1

LOOL I join Roblox before you and I made games more than you and I script better than you XD

1

Also I can explain my script.I gave him correct Script instead of your replies which doesn't benefit!

0

wouldn't this not work because PhysicsService needs the part .CanCollide to be true and some parts of the humanoid have it false?

0

:connect() is deprecated. Use :Connect().

This discussion is preserved as it was. New answers, comments, and votes are closed.