door = script.Parent --this is the door function onChatted(msg, recipient, speaker) -- convert to all lower case local source = string.lower(speaker.Name) msg = string.lower(msg) if (msg == "") then door.CanCollide = false door.Transparency = 0.7 wait(5) door.CanCollide = true door.Transparency = 0 end end function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end game.Players.ChildAdded:connect(onPlayerEntered)
You can combine two conditions using or
.
For example,
text == "apple" or text == "banana"
will be true
whenever either the left, or the right (or both) are true
.
By the way, since your question has already been answered, this is just a tip, and I am not looking to answer the question.
Using a function like a.b(a)
is equal to saying a:b()
. Therefore, it is unnecessary to use string.lower(speaker.Name)
or msg = string.lower(msg)
because it is the same as speaker.Name:lower()
or msg = msg:lower()
. Just a tip that you might appreciate since it saves you a few characters.