game.Players.LocalPlayer.Backpack:WaitForChild("Staff Card").Changed:Connect(function(newVal)
for i,child in pairs(game.Workspace.Staffdoors:GetChildren()) do
if child:IsA("Part") then
if newVal == true then
child.CanCollide = false
else
child.CanCollide = true
end
end
end
end)
Please help, I have no Idea why it is doing this. I want to make all the parts in the group, "Staffdoors" to not have collisions when a player possesses a certain tool. Please help!

6 comments
Someone please this is crucial to the development of my game
newValreturns the property that was changed/edited. :| Say you changed a part'sAnchoredproperty, the function will returnAnchored.So what do I do
Simply remove lines 4, 6, and 8.
Doesn't work
Try replacing line 4 with "if child.CanCollide == true then"