How do I make a short word to type player's name in this script?

As you can see from the title above.

local Players = game:GetService("Players")

local GroupId = 8402934
local MinimumRankToUseCommand = 100

Players.PlayerAdded:Connect(function(Player)
	if Player:GetRankInGroup(GroupId) >= MinimumRankToUseCommand then
		Player.Chatted:Connect(function(Message)
			local Words = string.split(Message, " ")
			local Command = Words[1]:lower()

			if Command == "!addpoint" then
				local NameOfPlayerToGivePoint = Words[2]
				local AmountOfPointsToGive = Words[3]

				local PlayerToGivePoint = Players:FindFirstChild(NameOfPlayerToGivePoint)

				if PlayerToGivePoint then
					PlayerToGivePoint.leaderstats.Points.Value += AmountOfPointsToGive
				end
			elseif Command == "!removepoint" then
				local NameOfPlayerToGivePoint = Words[2]
				local AmountOfPointsToGive = Words[3]

				local PlayerToGivePoint = Players:FindFirstChild(NameOfPlayerToGivePoint)

				if PlayerToGivePoint then
					PlayerToGivePoint.leaderstats.Points.Value -= AmountOfPointsToGive
				end
			end
		end)
	end
end)

Rather than I do the players full username. Is it possible to script this

1 Like

Maybe this topic can help you: How do I get a certain player from only a few characters? - #2 by eIiphant

1 Like