BAE Example Plugin

Can somone please tell me how I can create a plugin that will let staff warn players with “!warn <User(s)> <Reason(s)>” and jail players with 3 warnings with “!jail <User(s) <Reason(s)>” and view a players warnings and how many times they’ve been jailed with “!punishments <User(s)”. I duplicated the example plugin and got as far the plugin configuration for the warn command and I didn’t understand anything else. I will attach what I have so far down below for the warn command. I am completely clueless on how to make the jail and punishment plugins and the rest of the warn plugin. Your help is greatly appreciated!!

Warn Command

Payer 1 says command
“!warn gray Trolling”
(A hint will show up on Player 1’s screen confirming that the user was warned)
(A hint will show up on Player 2’s(troller) screen letting them know that they were warned)
(If player 1 types the user wrong it will say “User not found”)
(A player can only be warned if the user trying to be warned has 2 or less warnings. When a player is warned it will show up in the punishment menu displaying the reason and who warned them)

--[[
	
	 ____                                   
	/\  _`\                    __           
	\ \ \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 = 'warn'
	local pluginPrefix = Prefix
	local pluginLevel = 2
	local pluginUsage = "<User(s)> <Reason(s)>" -- leave blank if the command has no arguments
	local pluginDescription = "Warn a player if they are breaking rules."
	
	-- 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','Lorem Ipsum','Plugin Example',{'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,pluginDescription}
end

return Plugin
How the Jail command will work.

Once a player has run “!jail <User(s> <Reason(s)>” the player will be re-teamed to the team “Jailed”(Color: Really Red) and it will reset the person being jailed then reset their warnings to 0 and add another time the user has been jailed for the punishment menu. (The Jail command will only work if the user has 3 warnings)

Punishment Menu

When “!punishments <User(s)>” is run a menu on the left side of the screen(like the info menu) will pop up with all of the warnings they’ve gotten as well as the player that warned them and the reason and how many times they’ve been jailed and by who each time.

(I am not asking for someone to script this for me. I am asking for help to know how I can script and I am trying to learn how to script as I go. | I would be very appreciative if someone scripted it for me but I am just making it clear that it is not what I’m asking.)

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