Basic admin, help please!

need help with a plugin on basic admin, how can I input this?

local MinimumRank = 50 --REPLACE 254 WITH THE MINIMUM RANK ID TO USE THE DOOR COMMANDS
local Door1 = game.Workspace.Door1

local TweenService = game:GetService("TweenService")

game.Players.PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(Message)
		if Player:GetRankInGroup(GroupId) >= MinimumRank then
			if Message == ":opendoor" then
				local Door1Tween = TweenService:Create(Door1, TweenInfo.new(1), {Position = Door1.Position + Vector3.new(0, Door1.Size.Y, 0)})
				Door1Tween:Play()
			elseif Message == ":closedoor" then
				local Door1Tween = TweenService:Create(Door1, TweenInfo.new(1), {Position = Door1.Position - Vector3.new(0, Door1.Size.Y, 0)})
				Door1Tween:Play()
			end
		end
	end)
end)`
2 Likes

Can you specify what you need to be done. Are you getting errors on this? If so, what line?

1 Like

Unsure what the problem is here, but this would be run in a server script. You’d need to also add a variable called 'GroupId." It should work fine.

this is the script which isn’t working, doesn’t show any errors

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 = 'opendoor'
	local pluginPrefix = Prefix
	local pluginLevel = 2
	local pluginUsage = "" -- leave blank if the command has no arguments
	local pluginDescription = "Opens TC doors."
	
	-- 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 = ''
			local GroupId = 5620403 --REPLACE 1234567 WITH YOUR GROUP ID
			local MinimumRank = 50 --REPLACE 254 WITH THE MINIMUM RANK ID TO USE THE DOOR COMMANDS
			local Door1 = game.Workspace.Door1

			local TweenService = game:GetService("TweenService")

			game.Players.PlayerAdded:Connect(function(Player)
				Player.Chatted:Connect(function(Message)
					if Player:GetRankInGroup(GroupId) >= MinimumRank then
						if Message == ":opendoor" then
							local Door1Tween = TweenService:Create(Door1, TweenInfo.new(1), {Position = Door1.Position + Vector3.new(0, Door1.Size.Y, 0)})
							Door1Tween:Play()
						elseif Message == ":closedoor" then
							local Door1Tween = TweenService:Create(Door1, TweenInfo.new(1), {Position = Door1.Position - Vector3.new(0, Door1.Size.Y, 0)})
							Door1Tween:Play()
						end
					end
				end)
			end)
			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,'List','Doors Closed','1 and 2.',{'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
2 Likes