i was making a script that will open a door if a door touches it but TouchEnded will not close the door.
script.Parent.Touched:Connect(function(hit) if hit.name == "dttector" then script.Parent.Parent.a.Transparency = 1 script.Parent.Parent.b.Transparency = 1 script.Parent.Parent.c.Transparency = 1 script.Parent.Parent.d.Transparency = 1 script.Parent.Parent.e.Transparency = 1 end end) script.Parent.TouchEnded(function(hit) if hit.name == "dttector" then script.Parent.Parent.a.Transparency = 0.8 script.Parent.Parent.b.Transparency = 0 script.Parent.Parent.c.Transparency = 0 script.Parent.Parent.d.Transparency = 0 script.Parent.Parent.e.Transparency = 0 end end)
This error is very simple and I actually did the same thing even though I've been scripting for 2 years. You simply forgot to say :Connect
after TouchEnded