Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

TouchEnded not firing? help needed

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)

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.