Still have questions? Join our Discord server and get real time help.
0

# How can I remove the need of typing the full name of the target player in a chat command?

I am making an admin script for my game.

It is working fine, but I want to remove the need of typing the target player's full name. I want it so we only need to type like half of the name or less, and case insensitive.

Here is the script:

local admins = {"StrategicPlayZ", "1_7z", "Player1"}

for _, name in pairs(admins) do
if player.Name == name then
player.Chatted:Connect(function(msg)
if string.sub(msg, 1, 5) == "kill/" and game.Players:FindFirstChild(string.sub(msg, 6)) then
game.Players:FindFirstChild(string.sub(msg, 6)).Character:BreakJoints()
end
end)
end
end
end