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)
✓ ANSWER ACCEPTED
How would i make this script have multiple answers? Ex: Taco bell, Tacobell
2 answers
✓ Accepted answer
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Multiple answers for what?
I want it to accept 2 answers if the answer has a space, For example: Taco Bell, or TacoBell it would accept the answer and continue the script.