If Staffcard is a value inside the Backpack, you have to check if Staffcard.Value == true instead of just Staffcard == true (the instance itself will always be treated as being true). Also, if you wanted this to happen whenever the Staffcard value changed, you would have to put it in a Changed function. Also I'm not sure why you're tying to change the CanCollide of something if it isn't a part.
game.Players.LocalPlayer.Backpack:WaitForChild("Staffcard").Changed:Connect(function(newVal)
for i,child in pairs(game.Workspace.Workdoors:GetChildren()) do
if child:IsA("BasePart") then
if newVal == true then
child.CanCollide = false
else
child.CanCollide = true
end
end
end
end)
Otherwise, if it is a tool, you may want to look into using FindFirstChild or ChildAdded.
3 comments
What about this script isn't working?
Collisions aren't turning off
Please help