Say you were making and admin, how would you shorten names? I've tried string.match but couldn't get it working.

I've tried

Commands.kill = function(sender, args)
	if(CheckRank(sender) == "mod" or CheckRank(sender) == "admin" or CheckRank(sender) == "sadmin" or CheckRank(sender) == "owner" or CheckRank(sender) == "creator") then
		local msg = table.concat(args, " ")
		local plrtk = nil
		for plr in service.players:GetChildren() do
			if string.match(plr, msg) then
				plrtk = plr
				break
			end
		end
		if service.players:FindFirstAncestor(msg) ~= nil then
			service.players:FindFirstAncestor(msg).Character:BreakJoints()
		end
	end
	
end

but that would cause an error, "attempt to call a table value"

I do have tables like Commands and service defined.

1 comment

0

You would check the first x letters of the player's name and see if it corresponds with what they said. if someone says "awesome" you would check all the players, and using string.sub, you'd check which player's name begins with "awesome". Search up on youtube "pighead10 shortening names admin commands"