API Class: Tools.FindPlayerByPart() - SignatureBeef/Terraria-s-Dedicated-Server-Mod GitHub Wiki
Returns a list of players with the matching text at the start of their name. Useful for auto-completing partial names.
List FindPlayerByPart(string partName, bool ignoreCase = true)
-
Lua
Locates a player by name. As an example, this is using the SignTextSet hook. When a player inputs a name either partial or complete ignoring case, a full player name will be returned if a player's name is found matching the text on the sign.
function YourPlugin:OnSignTextSet(ctx, args)
Players = Tools.FindPlayerByPart(args.Text)
Tools.WriteLine(Players[0].name)
end