Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(?) I need help with player.Chatted

Asked by
chafava -113
5 years ago
if message == prefix and "test" then
                        print("gi")
                    end

I tried making a script where typing the prefix ';' and 'test; to join together as ';test', it should print "gi". I tried using the code above this text and simply got no errors, no warnings, but nothing happened, can you help with this script?

PS. This if then statement is inside a Player.Chatted function.

1 answer

Log in to vote
0
Answered by
pwx 1581 Moderation Voter
5 years ago

You almost had it, here you go:

if Message:lower() == prefix..'test' then
    print('gi')
end
0
is there a difference between using ' ' and " " for strings? User#28017 0 — 5y
0
There is no difference CrazyCreator chafava -113 — 5y
0
Wait, I had to unaccept the answer because the script wasn't working, can you provide a fix? chafava -113 — 5y
0
no actually it works, ty chafava -113 — 5y
Ad

Answer this question