-- ALEX WAS HERE LOL


local v1 = {};
local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
function v1.Currency(p1, p2, p3, p4)
	local v2 = u1.Saving.Get(p1);
	if not v2 then
		return;
	end;
	if not p2 or p2 ~= p2 then
		return print("Prevented possible NaN for giving coins", true);
	end;
	p3 = p3 or "Energy";
	p2 = math.round(p2 or 0);
	local v3 = v2[p3];
	if v3 == -1 then
		v3 = 0;
		v2[p3] = 0;
	end;
	v2[p3] = p4 and v2[p3] + p2 or math.clamp(v2[p3] + p2, 0, p3 == "Gems" and u1.Settings.MaxGems or u1.Settings.MaxEnergy);
	local v4 = v2[p3] - v3;
	return v4 ~= v3, v4;
end;
function v1.Slots(p5, p6)
	local v5 = u1.Saving.Get(p5);
	if not v5 then
		return;
	end;
	p6 = math.round(p6 or 0);
	v5.MaxSlots = math.clamp(v5.MaxSlots + p6, 1, u1.Settings.MaxSlots);
	--print(v5.MaxSlots ~= v5.MaxSlots)
	return true
end;

function v1.SkipFurtune(plr)
	local v2 = u1.Saving.Get(plr);
	if not v2 then
		return;
	end;
	v2.FurtuneWheel = 0
	return true
end
return v1;
