I have a script that uses player chatted to set a players class, here's a base of what I want the script to look like:
game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) if msg == "here" then print("lol") elseif msg == "here2" then print("lol1") end end) end)
If I say here it works, but if I say here2 it doesn't, how would I get around this (without changing the message)
I recommend using Players.PlayerChatted to do this.
local example = “test” if msg:sub(1, example:len()) == example then print(“message starts with “ .. example) end