Advertisement
xmaanzach

NoCanCollidePlayers Tutorial

Feb 13th, 2018
3,590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. script.Parent = game:GetService("ServerScriptService")
  2. local PhysService = game:GetService("PhysicsService")
  3. local PlayerGroup = PhysService:CreateCollisionGroup("p")
  4. PhysService:CollisionGroupSetCollidable("p", "p", false)
  5.  
  6. function NoCollide(model)
  7. for k,v in pairs(model:GetChildren())do
  8. if v:IsA"BasePart" then
  9. PhysService:SetPartCollisionGroup(v, "p")
  10. end
  11. end
  12. end
  13.  
  14. game:GetService("Players").PlayerAdded:connect(function(player)
  15. player.CharacterAdded:connect(function(char)
  16. char:WaitForChild("HumanoidRootPart")
  17. char:WaitForChild("Head")
  18. char:WaitForChild("Humanoid")
  19. wait(0.1)
  20. NoCollide(char)
  21. end)
  22. if player.Character then
  23. NoCollide(player.Character)
  24. end
  25. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement