Hello. I am wanting to know how I can detect, in this case print the text that gets put after the part in the chat that i am looking for. For an example, say the chat "requirement" is /kill. How would I be able to print what gets put right after the requirement?
1 | game.Players.PlayerAdded:Connect( function (player) |
2 | player.Chatted:Connect( function (message) |
3 | if message:match( "/kill" ) then |
4 | print ( string.sub( message , 6 ) ) |
5 | --[[string.sub takes 3 arguments. the first one is the string(the players message). the second argument is where you want the sub to start. and the 3rd is where the string ends]] -- |
6 | end |
7 | end ) |
8 | end ) |
if you don't really understand string.sub then go here https://developer.roblox.com/api-reference/lua-docs/string