I’m currently working on a custom admin system. Notifications, GUIs, ModuleScripts, the whole shazam. (for my own game)
I’ve made the commands already, but I’m setting up the execution. My execute function requires the set arguements, and I have no clue how to create a set amount of variables for the set amount of arguements. First, look at one of my simpler commands. (Just focus on execute and it’s variables)
Info.Commands.To = {
["command"] = ":to",
["ranon"] = "server",
["arguements"] = 2,
["requirement"] = 1,
["execute"] = function(player, PlayerToTeleport)
local StopLoop = false
local success, errormsg = pcall(function()
for i,v in pairs(game.Players:GetPlayers()) do
if StopLoop == false then
if string.match(string.lower(v.Name), string.lower(PlayerToTeleport)) then
StopLoop = true
local PlayerToTeleport = v
player.Character.HumanoidRootPart.CFrame = PlayerToTeleport.Character.CFrame * CFrame.new(0,0,-3, 0,math.rad(180), 0)
end
end
end
end)
if success and StopLoop then
return "Executed"
elseif not StopLoop then
return "PlayerNotFound"
elseif errormsg then
return errormsg
else
return "Fail"
end
end
}
Move onto my execution. (I’ll show the script for client commands execution.)
RepStor.AdminEvents.ClientExecution.OnClientInvoke = function(executeFunction, args)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7 = table.unpack(args)
local Result = executeFunction(game.Players.LocalPlayer, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
return Result
end
What I’m doing right now requires me to grab as much as I can. But if I give the variables as a full table, I’ll have to revamp all my commands. (Which is doable atm). Any thoughts, or should I pain my way through revamping my commands.