function onTouch(part)
if script.Parent.Parent:FindFirstChild("Flashlight") -- i think the error line
then
game.Workspace.Door.CanCollide = false
end
end
script.Parent.Touched:connect(onTouch)
✓ ANSWER ACCEPTED
How to make a door if a player holds a flashlight they can go throught a door?
1 answer
✓ Accepted answer
Just like this
game.Workspace.Door.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Flashlight") then
game.Workspace.Door.CanCollide = false
1 comment
0
Would recomend to fire a event so other can see it
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I think it would be better if when you equip your flashlight it can CanCollide = false by the client of course