Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i make a script that allows players to not collide? (non collide script)

Asked by 3 years ago

i cant seem to figure out how to make a script that allows players to not collide with each other. all the yt vids a watched were no help. can somebody help.

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Sorry Last Time I messed up.insert a script in workspace

Script:

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: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)


--Give me a Good Review and follow my roblox account
--if doesnt work tell me
0
Sorry Everyone i did it wrong JordanTheDev_Team 33 — 3y
0
dude u did not put it in script format venprince -2 — 3y
0
yes adithyapranesh 0 — 3y
Ad

Answer this question