BAE support command

Hey all, I’m trying to create a plugin command with Basic Admin Essentials 2.0, I have made the notification appear when a player says “!help”, however, I’m unsure on how to make it so the admin is teleported to the player who ran the command.

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]

	-- Plugin Configuration --
	local pluginName = 'help'
	local pluginPrefix = actionPrefix
	local pluginLevel = 0
	local pluginUsage = "" -- leave blank if the command has no arguments
	local pluginDescription = "Calls for an in-game admin."

	-- Example Plugin Function --
	local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
		local Player = Args[1]
		for i,v in pairs(game.Players:GetChildren()) do
			if returnPermissions(v) >= 1 then
				remoteEvent:FireClient(v,"Notif",Player.Name.." requires a MR+", "Click to teleport", "")
			end	
		end
	end

I am still needing help with this, so if anyone knows how to help me it will be greatly appreciated!

Are you unsure how to teleport the player to another player? If so, you can make a script to get the position of the person requesting help’s HumanoidRootPart, then use Humanoid:MoveTo() on the admin’s Humanoid.

How would I send that info to the ModuleScript? Do you know how I detect when the notification is clicked?

I don’t know anything about admin modules, sorry. I assumed you were using your own script.

1 Like

– Return Function –
return {
pluginName,
pluginPrefix,
pluginLevel,
pluginUsage,
pluginDescription,
pluginFunction
}
end

return Plugin

I solved my own problem, thanks to Mr. Brightside, this is what I ended up doing.
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]

-- Plugin Configuration --
local pluginName = 'help'
local pluginPrefix = actionPrefix
local pluginLevel = 0
local pluginUsage = "" -- leave blank if the command has no arguments
local pluginDescription = "Calls for an in-game admin."

-- Example Plugin Function --
local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
	local Player = Args[1]
	for i,v in pairs(game.Players:GetChildren()) do
		if returnPermissions(v) >= 1 then
			remoteEvent:FireClient(v,"Notif",Player.Name.." requires a MR+", "Click to teleport", "")
		end	
	end
end

-- Return Function --
return {
	pluginName,
	pluginPrefix,
	pluginLevel,
	pluginUsage,
	pluginDescription,
	pluginFunction
}

end

return Plugin

I am still in need of help!

skidjsds

Guessing you have figured it out by now but this is the one my group uses:

local Plugin = function(...)
	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 pluginName = 'help'
	local pluginPrefix = actionPrefix
	local pluginLevel = 0
	local pluginUsage = "" 
	local pluginDescription = "Calls for an in-game admin."
	local playerService = game:GetService('Players')
	
	local function pluginFunction(Args)
		local Player = Args[1]
		remoteEvent:FireClient(Player,'Hint','System | Help Request','Successfully called assistance, a Moderator will assist you shortly.')
		for a,b in next,playerService:GetPlayers() do
			local PlayerPermission = returnPermissions(b)
			if PlayerPermission > 0 then
				remoteEvent:FireClient(b,'Notif','Support Needed','Click to assist, '..Player.Name.."" ,{"Support", Player.Name})
			end
		end
	end
	remoteEvent.OnServerEvent:connect(function(Player,Key,...)
		local Data = {...}
		if Data[1] == "Notification Transfer" then
			if Data[2][1] == "Support" then
				Player.Character.HumanoidRootPart.CFrame =  game.Players[Data[2][2]].Character.HumanoidRootPart.CFrame*CFrame.new(0, 0, -7)*CFrame.Angles(0, math.pi, 0)
			end
		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