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

How would i make this script have multiple answers? Ex: Taco bell, Tacobell

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) 


2 comments

0

Multiple answers for what?

0

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.

2 answers

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.