local Players = game:GetService("Players") local play1Command = "/red" local function onPlayerChatted(player, message) if message:sub(1, play1Command:len()):lower() == play1Command then print("u say red") end end
You forgot to call your onPlayerChatted function
game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) onPlayerChatted(plr, msg) end) end)
Put this code somewhere in yours, and it should work
Let me know if I helped
Closed as Not Constructive by Dovydas1118, WoTrox, Optikk, and imKirda
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?