Ad
Log in to vote
0

Why does my 'Chatted' script accept everything if i put 'Or' in it?

Asked by 4 days ago

In every

player.Chatted

script i've ever made. Every time i've added 'Or'. It suddenly accepts everything. So to sum it up. If i put an 'Or' in my player.Chatted script. No matter what you say it fires it. Script

game.Players.PlayerAdded:Connect(function(plr)
    plr.Chatted:Connect(function(chat)
        if chat == "PlayAnim" or "playanim" then
            print(chat)
        end
    end)
end)

No matter what you say. It fires. Help? On a side note. How do i make it fire when the chat contains something? Like if it contains the word "bye," it would fire, So it would function when you said 'i gtg. bye'. Anyways. Thats my question(s)

2
Because the second clause yields no comparative evaluation. If you're looking to confirm another possible input, you'd have to maintain the operational logic: or chat == "playanim". Ziffixture 6444 — 4d
0
Oh. Thanks Galaxybombboy 85 — 4d

Answer this question