trying to script a key card door for a horror/adventure game, but i keep getting this error. what do i do and what does it mean?
script:
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "Keycard" then
script.Parent.CanCollide = false
script.Parent.Transparency = 0.5
wait(2)
script.Parent.CanCollide = true
end
end)
error message in output:
11:42:39.147 - Touched is not a valid member of Model
any help?

1 comment
Can you put the code into the lua block