argPlayerModule - Plain Player Finder for Commands

What is argPlayerModule?

A simple player finder that uses for commands, really simple.

Get A Module (Read Usage and Note first)

Usage

local argPlayerModule = require(path to this module)

local findPlayer = function(str)
	if str == 'me' then
		return tbl.executor
	else
		return argPlayerModule.GET(str)
	end
end

Note

This module supports a missing string for example:

Input: Dry/DryOff

Result: DryOfficial

Please keep in mind that Module only used for starter point:

WRONG:

Input: Official

Result: Nil

Expected Result: DryOfficial

The Result will be nil because your adding “Official” that the string doesnt start at.

CORRECT:

Input: Dry

Result: DryOfficial

The Result is correct but make sure make it more specific if the players are started on Same Name

Credits

DryOfficial: Owner

free feel to edit the source code and put yourself a credit and call yourself what you want.
im bad at english so i hope you understand it

Source Code
--[[

### argPlayerModule - Simple Player Finder for Commands ###

A basic Player Finder Module, useful for Admin Commands.
Use this basic function:

---

local argPlayerModule = require(path to this module)

local findPlayer = function(str)
	if str == 'me' then
		return tbl.executor
	else
		return argPlayerModule.GET(str)
	end
end

---

### Note ###

This module supports a missing string for example:

Input: Dry/DryOff
Result: DryOfficial

Please keep in mind that Module only used for starter point:

WRONG:

Input: Official
Result: Nil
Expected Result: DryOfficial

The Result will be nil because your adding "Official" that the string doesnt start at.

CORRECT:

Input: Dry
Result: DryOfficial

The Result is correct but make sure make it more specific if the players are started on Same Name

### Credits ###

DryOfficial: Owner

free feel to edit and put yourself in credits and thanks!~
im bad at english so i hope you understand it
--]]

local api = {}
local players = game:GetService('Players')

function api.GET(str:string)
	if str == nil then return error('str Parameter must be included!') end
	--assert(str ~= nil, 'str Parameter must be included!')
	if type(str) ~= 'string' then return error('str Parameter must be string!') end
	--assert(type(str) == 'string', 'str Parameter must be String!')
	local selectedplayer
	string.lower(str)

	for index,player in pairs(players:GetChildren()) do
		if player:IsA('Player') then
			local name = (player.Name):lower():sub(0,#str)

			if str == name then
				selectedplayer = player
			end
		end
	end

	return selectedplayer
end

return api

What do you think about my module?

  • Helpful
  • Not Helpful

0 voters

Feedback on my modules.

This my first module released.
Join my server, I am working some scripts!
Only Join if you want

Dry Corporation

Arent there 30 million roblox accounts
That means 30 million names

Can your argPlayerModule handle that
Because typing the full name is fine to me

1 Like

Bro it finds players in the current server, not across the whole website :skull:

4 Likes

Oops, mb

I think it still wouldnt be useful though, maybe in a 500 player server, but not for most games
Typing it out is just as easy

1 Like

Its just for convinience, also most the time if there’s an exploiter and you’re only able to find the first 3 letters of the name, its useful to use this

3 Likes

Thanks for the feedback, I guess. I don’t care the poll likely my module is not helpful at all.
This is my first Module Released, just I’m doing some experiments and some Module that wasn’t made so I try to make myself.

First of all, you shouldn’t be using assert() as it is bad for performance (just use a condition and error if true, same thing) And second of all, anyone could make this with knowledge of strings.

1 Like

I’ll try to use condition.
The Source code has been updated.

Right… I’ll try making something than this. Thanks for feedback.

1 Like