So i'm trying to make commands which use a grouping system but with modules. In one script holds the command - Which connects to the grouping parser after a player argument is parsed - This is then thrown into the corresponding module of which group has been selected. However, after it has reached the player category/group, i'm having trouble on returning the values to the original script for the command to take place.
For example:
Kill/!all
"!all" gets sent to the grouping "Parser" - Which then detects that we're after everyone so it goes to the "AllPlayers" module, collect all players and then... Well that bit I can't work out how to connect back to the original so it kills all players...
The kill command
return function(Speaker, plrName )
if plrName then
local ThePlayer = require(script.Parent.Parent.Settings.Groups.Parser)
ThePlayer.Obj(plrName)
plrName:BreakJoints()
print( string.format("Testing command on : '%s'!", plrName) )
else
warn( string.format("command '%s' got invalid arguments. Skipping..", script.Name ) )
end
end
The grouping Parser
local module = {}
function module.Obj(plrName)
if plrName:lower() == "!all" then
local AllPlayers = require(script.Parent.AllPlayers)
AllPlayers.Obj(plrName)
end
end
return module
All players module
local module = {}
function module.Obj(plrName)
local plrs = game:GetService("Players")
for i, player in pairs(plrs:GetPlayers()) do
plrName = player.Character
end
end
return module
How do I get the All players module connect back to the original kill command to make "plrName" die...
Thank you in advance!

1 comment
Sorry but this didn't work - It gives the error of BreakJoints is not apart of player; then if I add v.Character or selectedPlayer.Character it tells me character is not part of player.. any ideas?