Hello! I made a script to make me go through parts in the workspace, to do so I used a RemoteEvent that makes each part of my character CanCollide = false and it actually works, but it still won't let me go through parts. Here is my script. :) Any help?
local db = false local Character = script.Parent.Parent.Parent game.ReplicatedStorage.RemoteEvents.PermeationSkill.Permeate.OnServerEvent:Connect(function(plr) plr.Character.Humanoid.MaxHealth = 15 plr.Character.Humanoid.Health = 15 for i,v in pairs(Character:GetDescendants()) do if v:IsA("BasePart") then v.CanCollide = false v.Transparency = 0.65 Character.Humanoid.WalkSpeed = 7 end end end)
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)
The HumanoidRootPart Is Can Go Through, But The Other Parts Cant.
You Need To Change The Cancollide For Every Part.
If You Want It To Do It By Script,
for _, child in pairs(script.Parent:GetChildren()) do if child:IsA("Part") then child.Cancollide = false end -- You Can Also Put An Elseif instead. if child:IsA("BasePart") then child.Cancollide = false end end
Or Manually,
Select Each Body Parts And Change The Cancollide.
I just fixed this by using a Touched event and make the parts I touch CanCollide = false.