So I need help on how to make the keycard close the door too instead of waiting for the door to close itself? It's for a game I am making.
Here is the script I used, this is a script that I found online since I am not a pro in scripting.
script.Parent.Touched:Connect(function(hit)
if hit.Parent == "Keycard" then
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
wait(2)
script.Parent.Transparency = 1
script.Parent.CanCollide = true
end
end)

2 comments
So if this script is in the door area. I believe hit is the object it’s touching so the keycard would be hit. So just say hit.Name == “Keycard” then. If hit.Parent is the keycard and I’m dumb, then say hit.Parent.Name == “KeyCard”. If that solved it please tell me lol.
Okay thanks! Let me go try that, but what about the time though? Should I remove the "wait()" ??