script.Parent.touch.Touched:connect(function(h) if h.Name == "stream1" or "stream2" or "stream3" or "stream4" or "stream5" or "stream6" or "stream7" or "stream8" or "stream9" then print("good") script.Parent.fill.Transparency = 0 else print("bad") end end)
a simple script, but it always prints good. no matter what i hit with the brick, it always prints good. is it because there are too many ors?
You must ALWAYS put h.Name=="name". Otherwise, it will check if it's a string or something.. Idk, but it doesn't work.
Also, use a table
to make things easier.
local stream={"stream1","stream2","stream3","stream4","stream5","stream6","stream7","stream8","stream9"} script.Parent.touch.Touched:connect(function(h) for _,s in pairs(stream) do if s:lower()==h.Name:lower() then print'Good' script.Parent.fill.Transarency=0 else print'Bad' end end end)