Hi! So I am making a guess the logo type game and this is what I am using to check the player message:
local thecharacter = script.Parent.TheCharacter
if (msg == string.lower(thecharacter.Value or script.Parent.TheCharacter2.Value or script.Parent.TheCharacter3.Value or script.Parent.TheCharacter4.Value)) then
The problem is, the script is only traking theCharacter. Value and TheCharacter2.Value not the third and fourth value. Is the some way to fix this?
if msg == (string.lower(thecharacter.Value) or string.lower(script.Parent.TheCharacter2.Value) or string.lower(script.Parent.TheCharacter3.Value) or string.lower(script.Parent.TheCharacter4.Value)) then
This, but you guys are both treating it like English, and it’s not English.
This is how it should be formatted.
if msg == string.lower(a) or msg == string.lower(b) or msg == etc
You can’t compare values like this. Put them into a table and use table.find().
local thecharacter = script.Parent.TheCharacter
local msgs = {
string.lower(thecharacter.Value),
string.lower(script.Parent.TheCharacter2.Value),
string.lower(script.Parent.TheCharacter3.Value),
string.lower(script.Parent.TheCharacter4.Value)
}
if table.find(msgs, msg.lower()) then
I’m on mobile and didn’t want to type out all of the inputs such as the character.Value. it’s the format you need to pay attention to though, don’t copy it directly
Does it have an error? I did edit the script a few seconds after posting it after realizing I messed up on something. If it doesn’t have an error, it has nothing to do with what I provided, but rather what the script is receiving.
local found = (
msg == string.lower(thecharacter.Value) or
msg == string.lower(script.Parent.TheCharacter2.Value) or
msg == string.lower(script.Parent.TheCharacter3.Value) or
msg == string.lower(script.Parent.TheCharacter4.Value)
)
if found == true then
print("matched!")
end
Try printing msg and check whether it is what you think it is or that it matches.
local thecharacter = script.Parent.TheCharacter
local msgs = {
string.lower(thecharacter.Value),
string.lower(script.Parent.TheCharacter2.Value),
string.lower(script.Parent.TheCharacter3.Value),
string.lower(script.Parent.TheCharacter4.Value)
}
print(msg, msgs)
if table.find(msgs, msg.lower()) then