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='
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)