I'm trying to make admin commands by linking modules to different sections.
So far, my script connects to the correct command module, which then brackets off to the parser which determines what player/group it's going to perform the command on, it then brackets off to the player/group module which then tells the script how it's going to run; Eg. Group: All - would select all players - It would then return that module back to the original kill module and kill everyone...
However, the modules aren't working in the correct way and is only causing the speaker to die instead of the whole server.. Any ideas?
Kill Command Module
return function(Speaker, plrName )
if plrName then
local ThePlayer = require(script.Parent.Parent.Settings.Groups.Parser)
local selectedPlayer = ThePlayer.Obj(plrName)
if typeof(selectedPlayer) == "table" then
for _, v in pairs(selectedPlayer) do
v:BreakJoints()
end
else
selectedPlayer:BreakJoints()
end
print( string.format("Testing command on : '%s'!", plrName) )
else
warn( string.format("command '%s' got invalid arguments. Skipping..", script.Name ) )
end
end
Parser Module
local module = {}
function module.Obj(plrName)
if plrName:lower() == "!all" then
local AllPlayers = require(script.Parent.AllPlayers)
return AllPlayers.Obj(plrName)
end
end
return module
AllPlayers Module
local module = {}
function module.Obj(plrName)
local plrs = game:GetService("Players")
for i, player in pairs(plrs:GetPlayers()) do
plrName = player.Character
return plrName
end
end
return module
Thank you in-advance!

4 comments
It seems to be returning a tuple, not a table.
How would I go about returning a table rather than the tuple?
Also could you explain what a tuple is please as i'm not quite sure..
https://developer.roblox.com/en-us/articles/Tuple