-- ALEX WAS HERE LOL

local v1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
while not v1.Loaded do
	game:GetService("RunService").Heartbeat:Wait();
end;
local u1 = nil;
function Unlock()
	u1:Destroy();
end;
function IsUnlocked()
	if v1.Save.Get().OwnsVaultGate then
		return true;
	end;
	return false;
end;
function Buy()
	local v2, v3 = v1.Network.Invoke("Buy Vault Gate");
	if not v2 then
		v1.Message.New(v3 or "Error");
	else
		Unlock();
		return;
	end;
end;
function Prompt()
	if v1.Message.New("Do you want to unlock ?", true) then
		Buy();
	end;
end;
function Setup()
	local v4 = v1.WorldCmds.GetMap();
	if v4:FindFirstChild("Interactive") then
		u1 = v4.Interactive:FindFirstChild("Secret Vault");
		if u1 then
			if IsUnlocked() then

			else
				local v5, v6 = v1.Interact.Add(u1:FindFirstChild("Interact"), {
					dist = 15
				});
				v5:Connect(function()
					Prompt();
				end);
				return;
			end;
		else
			return;
		end;
	else
		return;
	end;
	Unlock();
end;
v1.Signal.Fired("World Changed"):Connect(function(p1)
	if p1 == "Haunted" then
		Setup();
	end;
end);
