Basic admin essentials plugin help [REPOST]

hey everyone

recently i created a plugin where when a player says !support, it will show a notification and fire a seperate system outside of the admin command system that will teleport an admin to help them, but when i do the !support command, i have to say !support me for it to work while i just want to say !support.

if anyone could help i’d be very appreciative.
thanks, and heres my code.

`–[[

 ____                                   
/\  _`\                    __           
\ \ \L\ \     __      ____/\_\    ___   
 \ \  _ <'  /'__`\   /',__\/\ \  /'___\ 
  \ \ \L\ \/\ \L\.\_/\__, `\ \ \/\ \__/ 
   \ \____/\ \__/.\_\/\____/\ \_\ \____\
    \/___/  \/__/\/_/\/___/  \/_/\/____/
                                        
            
Admin Essentials v2
Plugin Documentation
*coming soon^tm

If you have any questions regarding Plugins, contact TheFurryFish.
–]]

local Plugin = function(…)
local Data = {…}

-- Included Functions and Info --
local remoteEvent = Data[1][1]
local remoteFunction = Data[1][2]
local returnPermissions = Data[1][3]
local Commands = Data[1][4]
local Prefix = Data[1][5]
local actionPrefix = Data[1][6]
local returnPlayers = Data[1][7]
local cleanData = Data[1][8] -- cleanData(Sender,Receiver,Data)
-- Practical example, for a gui specifically for a player, from another player
-- cleanData(Sender,Receiver,"hi") -- You need receiver because it's being sent to everyone
-- Or for a broadcast (something everyone sees, from one person, to nobody specific)
-- cleanData(Sender,nil,"hi") -- Receiver is nil because it is a broadcast

-- Plugin Configuration --
local pluginName = 'support'
local pluginPrefix = actionPrefix
local pluginLevel = 1
local pluginUsage = "" -- leave blank if the command has no arguments
local pluginDescription = "Call for an admins support."

-- Example Plugin Function --
local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
	local Player = Args[1]
	if Args[3] then
		local Victims = returnPlayers(Player, Args[3]) if not Victims then return end
		local combinedVictims = ''
		for a,b in pairs(Victims) do
			if combinedVictims == '' then
				combinedVictims = b.Name
			else
				combinedVictims = combinedVictims..', '..b.Name
			end
		end
		for a,b in next,Victims do
			remoteEvent:FireClient(b,'Notif','Mocha Administration','Secuessfully called for support.',{'Message','Results',combinedVictims})
		end
	end
end

-- Return Everything to the MainModule --
local descToReturn
if pluginUsage ~= "" then
	descToReturn = pluginPrefix..pluginName..' '..pluginUsage..'\n'..pluginDescription
else
	descToReturn = pluginPrefix..pluginName..'\n'..pluginDescription
end

return pluginName,pluginFunction,pluginLevel,pluginPrefix,{pluginName,pluginUsage,plug

sorry im confused, where do i put this? i dont really script so this is a foreign language to me lol

Actually nvm, i just revised your code instead:

`–[[

 ____                                   
/\  _`\                    __           
\ \ \L\ \     __      ____/\_\    ___   
 \ \  _ <'  /'__`\   /',__\/\ \  /'___\ 
  \ \ \L\ \/\ \L\.\_/\__, `\ \ \/\ \__/ 
   \ \____/\ \__/.\_\/\____/\ \_\ \____\
    \/___/  \/__/\/_/\/___/  \/_/\/____/
                                        
            
Admin Essentials v2
Plugin Documentation
*coming soon^tm

If you have any questions regarding Plugins, contact TheFurryFish.
–]]

local Plugin = function(…)
local Data = {…}

-- Included Functions and Info --
local remoteEvent = Data[1][1]
local remoteFunction = Data[1][2]
local returnPermissions = Data[1][3]
local Commands = Data[1][4]
local Prefix = Data[1][5]
local actionPrefix = Data[1][6]
local returnPlayers = Data[1][7]
local cleanData = Data[1][8] -- cleanData(Sender,Receiver,Data)
-- Practical example, for a gui specifically for a player, from another player
-- cleanData(Sender,Receiver,"hi") -- You need receiver because it's being sent to everyone
-- Or for a broadcast (something everyone sees, from one person, to nobody specific)
-- cleanData(Sender,nil,"hi") -- Receiver is nil because it is a broadcast

-- Plugin Configuration --
local pluginName = 'support'
local pluginPrefix = actionPrefix
local pluginLevel = 1
local pluginUsage = "" -- leave blank if the command has no arguments
local pluginDescription = "Call for an admins support."

-- Example Plugin Function --
local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
	local Player = Args[1]
	remoteEvent:FireClient(b,'Notif','Mocha Administration','Secuessfully called for support.',{'Message','Results',combinedVictims})
end

-- Return Everything to the MainModule --
local descToReturn
if pluginUsage ~= "" then
	descToReturn = pluginPrefix..pluginName..' '..pluginUsage..'\n'..pluginDescription
else
	descToReturn = pluginPrefix..pluginName..'\n'..pluginDescription
end

return pluginName,pluginFunction,pluginLevel,pluginPrefix,{pluginName,pluginUsage,plug

thank you so much for your help!! :smile:

one more question, do you know how to make it included in the plugin where it calls the admin? i couldn’t figure that out either. i can litterly edit the ui and thats it lol

and for some reason this script dosent seem to work for me

You need a basic understanding of scripting in order to at least know what you’re seeing. I think making your own admin is easier than Admin Essentials imo

at the bottom of the script add this to fix it:

end
return Plugin;

About the part where it calls the admin, regular Basic Admin doesn’t support commands like that. You’ll want to check out other more advanced admin systems such as Commander (just the first one that came to mind) to do that (provided out-of the box). If you prefer Basic Admin Essentials enough, you may consider just forking the module to provide the functionality you desire (although this is hard, you’ll have to change >100 lines of code prolly).

Thank you so much! Appreciate your help

1 Like

hey there, i actually switched over to commander due to your recommendation, and im super glad! i didn’t know if you knew how to set it up with group ranks? if you can i’d love your help! thanks

In module.Admins, type this: ["x:>y"] = "z" where x is your group ID, y is the minimum group perm level, and z is the level.

So something that looks like this:
["123123123:>155"] = "Owner"

1 Like

hey there, just got to the settings portion of this, and i tried this although it’s not working.

I’m not sure what’s going on then. Thats what the documentation said.

You can check the commander docs for yourself here: commander-site/admin.md at master · 7kayoh/commander-site · GitHub

thanks! i couldn’t find the documentation for the life of me, for some reason i pasted in what that said (which was the same as what you said) and it worked, no clue why but thank you! :smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.