--script:Destroy();

folder.Parent = nil;
spawn(function()
	wait(0.5)
	if folder.Parent ~= nil and folder.Parent ~= player then
		folder.Parent = nil;
	end
end)


if module and module:IsA("ModuleScript") then
	warn("Loading Folder...")
	local nameVal
	local origName
	local depsFolder
	local clientModule
	
	warn("Waiting for Client & Special")
	nameVal = folder:WaitForChild("Special", 30)
	
	warn("Checking Client & Special")
	--callCheck(nameVal)
	--callCheck(clientModule)
	
	warn("Getting origName")
	origName = (nameVal and nameVal.Value) or folder.Name
	warn("Got name: "..tostring(origName))
	
	warn("Changing child parent...")
	folder.Parent = nil
		
	warn("Destroying parent...")
	
	print("Debug: Loading the client?")
	local meta = require(module)
	warn("Got metatable: "..tostring(meta))
	if meta and type(meta) == "userdata" and tostring(meta) == "Adonis" then
		local ran,ret = pcall(meta,{
			Module = module, 
			Start = start,
			Loader = script,
			Name = origName, 
			LoadingTime = loadingTime,
			CallCheck = callCheck,
			Kill = Kill
		})
				
		warn("Got return: "..tostring(ret))
		if ret ~= "SUCCESS" then
			warn(ret)
			Kill("ACLI: Loading Error [Bad Module Return]")
		else
			print("Debug: The client was found and loaded?")
			warn("Client Loaded")
			--folder.Parent = nil
			
			if container and container:IsA("ScreenGui") then
				container:Destroy();
			end
		end
	end
end
