Basic Admin Essentials Plugin Help "opendoors"

--[[
	
	 ____                                   
	/\  _`\                    __           
	\ \ \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 = 'opendoors'
	local pluginPrefix = Prefix
	local pluginLevel = 3
	local pluginUsage = "" -- leave blank if the command has no arguments
	local pluginDescription = "Opens all doors in the game."

	-- Example Plugin Function --
	local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
		for _, door in pairs(game.Workspace.Doors:GetChildren()) do
			if door:IsA("Part") and door:FindFirstChild("CanCollide") then
				door.CanCollide = false
			end
		end
		local message = "All doors have been opened."
		remoteEvent:FireClient(Args[1], 'Notif', 'Admin')


I need help with the code, in this code I try to create a plugin so that when you run the opendoors command all doors open, for some reason I can’t run this command, can someone help me?

2 Likes

try this

-- Example Plugin Function --
local function pluginFunction(Args) -- keep the name of the function as "pluginFunction"
	for _, door in pairs(game.Workspace.Doors:GetChildren()) do
		if door:IsA("UnionOperation") and door.CanCollide == true then
			door.CanCollide = false
		end
	end
	local message = "All doors have been opened."
	remoteEvent:FireClient(Args[1], 'Notif', 'Admin')
end
2 Likes

i try and not working, Never mind.

are your doors unions or parts?

um i think unions thank you for help me.

1 Like