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