I don't know much about scripting but I'm trying to make it where if a person says for example "cat" and or "dog" the door will open. I'm having trouble getting it to take more than one correct answer and this is the code that I am using. I don't know if I should be using stringvalue for this or what I should change in order for it to work.
door = script.Parent
function onChatted(msg, recipient, speaker)
local source = string.lower(speaker.Name)
msg = string.lower(msg)
local thecharacter = script.Parent.TheCharacter
local decal = script.Parent.Decal
if (msg == string.lower(thecharacter.Value)) then
door.CanCollide = false
door.Transparency = 0.7
decal.Transparency = 0.7 (IMPORTANT)
wait(2)
decal.Transparency = 0(IMPORTANT)
door.CanCollide = true
door.Transparency = 0
end
end
game.Players.ChildAdded:connect(function(plr)
plr.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, plr) end)
end)

3 comments
please use the correct lua formating!
I've edited the question to use the code block (you can add it yourself in the future with the little "Lua" icon to the right of Bold/Italics/etc).
Sorry I wasn't quite sure how to format it correctly