I tried using ABritishChaps string:sub idea, but it did not work and the SH Discord said string.find is better, can anyone help?
1 | if string.find(prefix, "kill " ) then |
2 | print ( "found that" ) |
3 | target = game.Players:FindFirstChild(msg:sub( 7 )) |
4 | print (target) |
5 |
6 |
7 |
8 | end |
ps. Already put player.chatted and stuff! I will do the kill function later but for now the script just lets me know if it is working!
string string.sub ( string s, int i = 1, int j = -1 )
1 | if string.sub(msg, 1 , 6 ) = = prefix .. "kill " then -- If the command starts with the prefix |
2 | local target = string.sub(msg, 7 ) -- Use string.sub to substring the prefix and command from the "target" |
3 | print (target) -- print the target |
4 | end |
oh yeah u should work on ur whitespacing i dont know how could SH be so bad at scripting lmao