function CheckWhitelist(s)for P=1,#Whitelist,1 do if s==Whitelist[P]then return true end end return false end Door.Touched:Connect(function(s)if game.Players:GetPlayerFromCharacter(s.Parent)then local P=game.Players:GetPlayerFromCharacter(s.Parent)if Gamepass<=0 then return nil end if MS:UserOwnsGamePassAsync(P.UserId,Gamepass)or CheckWhitelist(P.UserId)then Door.CanCollide,Door.Transparency=false,OpenTrans wait(OpenTime)Door.CanCollide,Door.Transparency=true,CloseTrans else Door.CanCollide,Door.Transparency=true,CloseTrans if BuyGUI==true then MS:PromptGamePassPurchase(P,Gamepass)end if KillOnTouch==true then P.Character.Humanoid.Health=0 end end end end)
-----------------------------------------------------------------------------------------------

function CheckWhitelist(v)
	for i = 1, #Whitelist do
		if v == Whitelist[i] then
			return true
		end
	end
	return false
end

Door.Touched:Connect(function(hit)
	if game.Players:GetPlayerFromCharacter(hit.Parent) then
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if Gamepass <= 0 then
			return nil
		end
		if MS:UserOwnsGamePassAsync(plr.UserId, Gamepass) or CheckWhitelist(plr.UserId) then
			Door.CanCollide, Door.Transparency = false, OpenTrans
			wait(OpenTime)
			Door.CanCollide, Door.Transparency = true, CloseTrans
		else
			Door.CanCollide, Door.Transparency = true, CloseTrans
			if BuyGUI == true then
				MS:PromptGamePassPurchase(plr, Gamepass)
			end
			if KillOnTouch == true then
				plr.Character.Humanoid.Health = 0
			end
		end
	end
end)
