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

How do I make this Door card script actually work and function correctly?

script.Parent.Touched:connect(function(Part)
		if Part.Name == "Card" then
		if Part.Handle.CardNumber.Value == script.Parent.RoomNumber.Value then
			print("Holy you did it!")
			else print("well fudge.")
		end
		end
end)


There's no errors, and all values match. What am I doing wrong? Help would be great =u='

1 comment

0

is it a local script?

1 answer

✓ Accepted answer
script.Parent.Touched:connect(function(hit)
	if hit.Name == "Card" and hit.Handle.CardNumber.Value == script.Parent.RoomNumber.Value then
		script.Parent.CanCollide = false
	end
end)

This should do it; however if you would like to make it close after a few seconds then do this.


script.Parent.Touched:connect(function(hit)
	if hit.Name == "Card" and hit.Handle.CardNumber.Value == script.Parent.RoomNumber.Value then
		script.Parent.CanCollide = false
		wait(5)
		script.Parent.CanCollide = true
	end
end)

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