Alright, so the other day I thought it would be fun to make my own personal admin system. For no one else's use except mine. So, I made the first basic command and I'm already hitting a blockade. For some reason, this isn't working and I'm not quite sure why. Here's my script:
repeat wait() until game.Players.LocalPlayer.Character
Player = game.Players.LocalPlayer
Char = Player.Character
Player.Chatted:connect(function(Message)
local Length = string.len(Message)
print(Length)
if Message:sub(1, 15) == "System Command:" then
print("First Step")
if Message:sub(17, 20) == "Kill" then
print("Second Step")
local Target = Message:sub(21)
game.Workspace:FindFirstChild(Target).Torso:Remove()
end
end
end)
So this SAO-esque script is actually a LocalScript in StarterPack
This is the error I'm getting:
https://gyazo.com/65e08ad8cf12b208820d0ba09765b857 (The link function wouldn't work/is broken)
Thanks in advance

5 comments
To be honest, this makes me wanna start working on something like this...
Me too
Ah, thank you. Such a simple mistake. Also, the reason I was removing the torso was just in case someone was to exploit their health.
Ah. Makes sense.
There's a very major problem with this code: What if the player isn't in the server? The script will error. ;c