Basic Admin | Plugin Help Part 2

Hey Developers! Recently I was working with Basic Admin Essentials plugins. I was trying to make a custom command (plugin) that shows some different things, of course on the list feature, opened with a notif, similar to how to donor perks or command list opens.

My plugin code (in the module script inside plugins) is as follows:



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 = 'settings'
	local pluginPrefix = "!"
	local pluginLevel = 2
	local pluginUsage = "" -- leave blank if the command has no arguments
	local pluginDescription = "Server settings"

	-- Example Plugin Function --
	local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
		local Player = Args[1]
		local Victims = returnPlayers(Player,Args[3],Args[2]) if not Victims then return end -- this will ignore the command if you're not include the player(s).
		for a,b in next,Victims do
			remoteEvent:FireClient(b, 'Notif','System','Show List.',{'List','Settings','testing'})
		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,pluginDescription}
end

return Plugin

Any and all help is appreciated, thanks.

Note: This works if I do !settings me, but only shows the little notification. The expected behavior is to make it work by just saying !settings and having a notification AND list pop up when notification is clicked.

2 Likes

Would you be able to provide a model so I could look further into this?

1 Like

I provided what you need, the plugin code.

1 Like

If you want the command to execute on other players, add the pluginUsage as β€œ<User(s)>”, then, do this:

local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
		local Player = Args[1]
		local Victims = returnPlayers(Player,Args[3],Args[2]) if not Victims then return end -- this will ignore the command if you're not include the player(s).
		for a,b in next,Victims do
			remoteEvent:FireClient(b, 'Notif','System','Show List',false,true,{'List','Settings',{"List1","List2","List3"}})
		end
	end

However, if you want the command to execute to yourself, leave the pluginUsage as β€œβ€, then do this:

local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
		local Player = Args[1]
		-- Victims will be removed
			remoteEvent:FireClient(Player, 'Notif','System','Show List',false,true,{'List','Settings',{"List1","List2","List3"}})
	end

Keep in mind that you must keep the list’s content inside an array, and inside it must be a string/strings. Please let me know if this does not work.

Thanks for the response! Unfortunately, this did not work. There error I am getting is:
Players.UsedSpxse.PlayerScripts.Essentials Code:1944: attempt to index boolean with number

2 Likes

Apologies, I did some mistake while doing this. Here is the correct version of the script:

remoteEvent:FireClient(Player, 'Notif','System','Show List',{'List','Settings',false,true,{"List1","List2","List3"}})
1 Like

It still does not work, thanks for the assistance though. Players.UsedSpxse.PlayerScripts.Essentials Code:1947: invalid argument #3 (string expected, got table)

1 Like

Well. You are required to test it in the roblox game itself. Studio does not work sometimes. This happens to me myself sometimes either! :>

This post is old and resolved as well.