game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) local testM = "test" if msg == string.match(testM, "%w+") then print(msg) end end) end)
I am trying to make a command shortcut When player types like "te" it does "print(msg)"
Im new to string.match so can someone help me, please?
Here this should work
game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) local testM = "test" if msg == string.sub(testM, 1,2) then print(msg) end end) end)