Basic Admin Essentials 2.0 Training Command

I am trying to figure out how to make a training command through Basic Admin Essentials 2.0, I have looked in several locations over the DevForum and cannot find anything. Can anyone assist me?

COMMAND FUNCTION

When I sat :training in the chat system, it will send a Server Message, wait 14 seconds, then send another one until it reaches the last training message.

2 Likes

Place this script inside the Basic Admin plugins folder in a MODULESCRIPT
Edit messages ect to whatever you want + add more.

	local Data = {...} 

	local remoteEvent = Data[1][1] 
	local pluginName = "training" -- cmb name
	local pluginPrefix = "!" -- cmd prefix
	local pluginRank = 2 -- Admin Lvl to use cmd
	local pluginDesc = "Starts The Training" -- Cmd description

	local InformationMessages = {"Message2", "Message1"} -- Displayed Messages

	local DisplayTime = 5 --display time

	local pluginFunction = function(Args) 
		local Player = Args[1]
		for _, Message in pairs(InformationMessages) do 
			remoteEvent:FireAllClients('Message', 'Training Message', Message) 
			wait(DisplayTime) 
		end
	end
	pluginDesc = pluginName .. " " .. pluginDesc

	return pluginName, pluginFunction, pluginRank, pluginPrefix, {pluginName, pluginDesc} 
end

return Plugin

unfortunately i am coming across an issue! do you know whats wrong with it?

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}

You forgot this above, replace the above with:

pluginDesc = pluginName ..""..pluginDesc

return pluginName,pluginFunction,pluginRank,pluginPrefix,{pluginName,pluginDesc}
end

As that is very crucial when adding plugins.

Hi, there seems like you’ve missed some parts!

local Data = {...}
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]

local remoteEvent = Data[1][1] 
	local pluginName = 'training'
	local pluginPrefix = Prefix
	local pluginLevel = 2
	local pluginUsage = "<User>" -- leave blank if the command has no arguments
	local pluginDescription = "Posts the information about the training thing."

local InformationMessages = {"Message2", "Message1"} -- Displayed Messages

local DisplayTime = 5 --display time

local pluginFunction = function(Args) 
	local Player = Args[1]
	for _, Message in pairs(InformationMessages) do 
		remoteEvent:FireAllClients('Message', 'Training Message', Message) 
		wait(DisplayTime) 
	end
end

	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
5 Likes

thanks for your help! i couldnt figure this out on my own before, lol