Add All Values not working

This should work, but it is in an infinite loop. Meaning this will constantly add to AllStats …forever.

local replicatedStorage = game:GetService("ReplicatedStorage")
local data = replicatedStorage:WaitForChild("Data")
local allStats = data:WaitForChild("AllStats")

while true do --it's better to do it like this so you don't needlessly wait that first time
	local potions = data:GetDescendants()

	for i, v in pairs(potions) do
		if v.Name == "PotionX2" then
			allStats.Value += v.Value
			print(allStats.Value)
		end
	end
	wait()
end

If that isn’t what you want, then just remove the while true do (and the “end”) and it’ll only run once.

A couple of sidenotes though: I suggest reading through this link so you know more about what is actually happening when you call wait() Avoiding wait() and why.

Also, a lot of scripters start out using value instances, but instead switch to storing the values in variables/tables. There are several reasons for doing this, but just know that every time you change that value instance from the server in a space that’s viewable by both the client and the server …there is a built-in remote that is fired to the client. This means it can be expensive bandwidth wise if you change too many large values too many times.