--End of example plugin
----------------------------------------------------------------------------
--[[
--Below are some real plugins that are functional.

--As another example I have included a plugin that will change the permissions of specific commands. You can see it below.

return function(set)
--make the table that holds our new perms and what command they are for
local coms={
	{cmd='insert',perms=5};
	{cmd='m',perms=5};
	{cmd='gear',perms=5};
} --Changes insert, m, and gear to place owners only.

--These are the commandss and the new permission level, refer to the top of Example Plugin for perm levels.
-- Do note the cmd HAS to be the command thats shown in :cmds command, so if you want tornado to
-- be usable by the game owner only you would put {cmd='tornado',perms=5}; but you CAN NOT user twister instead of tornado.
 
for i=1,#set.Commands do --grab commands, for i,v in pairs for some reason does not like to work for this
	coroutine.wrap(function() --wrap it to make the process go a little faster overall
	for k,v in pairs(coms) do --grab our table with the new command perms
		if v.cmd==set.Commands[i].Cmds[1] then -- if the cmd is the same as the first cmd of the target command then...
			set.Commands[i].AdminLevel=v.perms --set its admin level to our intended one.
		end
	end
	end)()
end
end

------------------------------------------------------------------------
below is a plugin I made for an automated barista bot that allows it to get chats from
the admin script and send them to the barista bot for processing, for server to server
communication like this its recommended to use bindable events, for more information here 
is the bindable event roblox wiki link: http://wiki.roblox.com/index.php?title=Bindableevent

return function(set)
local barista
for i,v in pairs(workspace:children()) do
	if v.Name=='Jessica' and v:IsA('Model') and v:FindFirstChild('BaristaStuff') then barista=v end
end --find the barista
local backup=barista:Clone() --make a backup of the barista
	set.MakePluginEvent('Chat',function(msg,plr) --Add a new function to run on chat for the plugin
		local sendchat=barista.BaristaStuff.Event --Declare the event
		sendchat:Fire(msg,plr) --send the chat to the barista
	end)
	--lets make the reset and on/off commands
	set.MakeCommand('Reset Barista',2,set.Prefix,{'resetbarista','fixbarista'},{},0,function(plr,args)
		barista:Destroy() --destroy old barista
		barista=backup:Clone() --clone the backup
		barista.Parent=workspace --put it in workspace
		barista:MakeJoints() --make some joints
	end)
	set.MakeCommand('Turn Barista On/Off',3,set.Prefix,{'barista'},{'on/off'},1,function(plr,args)
		if args[1]=='off' then
			barista:Destroy()
		elseif args[1]=='on' then
			barista=backup:Clone()
			barista.Parent=workspace
			barista:MakeJoints()
		end
	end)--does basically the same stuff as reset.
end
--]]