-- Remove this after you've become acquainted with EventSequencer

if RunService:IsStudio() then
	-- Best practice is to configure this ahead of time and don't use this
	-- This is for demo purposes so that it works out of the box
	Players.PlayerAdded:Connect(function(player)
		table.insert(playerIDs, player.UserId)
		EventSequencer.setSeekingPermissions({
			-- Replace this with non-production PlaceIds 
			placeIDs = {game.PlaceId},
			groups = {
				-- Replace this if you want certain groups allowed
				-- The following is an example of one group permissions
				{GroupID = 7384468, MinimumRankID = 5}
			},
			-- Replace this with known player IDs in a table
			playerIDs = playerIDs
		})
	end)
	
	local playersService = game:GetService("Players")
	local playerAdded = function(player)
		if not table.find(playerIDs, player.UserId) then
			table.insert(playerIDs, player.UserId)
		end
	end
	playersService.PlayerAdded:connect(playerAdded)
	for _, player in ipairs(playersService:GetPlayers()) do
		playerAdded(player)
	end
	
	EventSequencer.setSeekingPermissions({
		-- Replace this with non production PlaceIds 
		placeIDs = {game.PlaceId},
		groups = {
			-- Replace this if you want certain groups allowed
			-- The following is an example of one group permission
			{GroupID = 7384468, MinimumRankID = 5}
		},
		-- Replace this with known player IDs in a table
		playerIDs = playerIDs
	})
end
