Value not detected in ServerStorage

Local Script in StarterPlayerScripts

local cloning = game.ReplicatedStorage.Cloning
local num = game.ReplicatedStorage.Cloning.Num
local limit = game.ReplicatedStorage.Limit
num.Value = 0
print(1)
while wait() do
	if num.Value == 0 then
		if game.ServerStorage.Level.Value == 6 then
			local RandomEntity = math.random(1, 100)
			cloning.X.Value = 96
			cloning.Y.Value = 0.5
			cloning.Z.Value = -27
			num.Value += 1
			if RandomEntity <= 80 then
				print(100)
				cloning.Bandit_1:FireServer()
			else 
				print(200)
				cloning.Strong_Bandit_2:FireServer()
			end
			wait(0.5)
			local RandomEntity = math.random(1, 100)
			cloning.X.Value = 96
			cloning.Y.Value = 0.5
			cloning.Z.Value = 0
			num.Value += 1
			if RandomEntity <= 80 then
				print(100)
				cloning.Bandit_1:FireServer()
			else 
				print(200)	
				cloning.Strong_Bandit_2:FireServer()
			end
			wait(0.5)
			local RandomEntity = math.random(1, 100)
			cloning.X.Value = 96
			cloning.Y.Value = 0.5
			cloning.Z.Value = 27
			num.Value += 1
			if RandomEntity <= 80 then
				print(100)
				cloning.Bandit_1:FireServer()
			else 
				print(200)
				cloning.Strong_Bandit_2:FireServer()
			end
		end
	end
end

Script in Workspace

local cloneValues = Instance.new("Folder")
cloneValues.Parent = game.ServerStorage
cloneValues.Name = "CloneValues"
local Level = Instance.new("NumberValue")
Level.Parent = game.ServerStorage
Level.Name = "Level"
game.Players.PlayerAdded:Connect(function(plr)
	while wait( ) do
		local level = plr:WaitForChild("leaderstats").Level.Value 
		Level.Value = level
	end
end)

It doesn’t detect the Level in ServerStorage, I really need help. I’ve been trying for 20 minutes

LocalScripts cannot access ServerStorage or ServerScriptService. They are server-locked for security reasons.

A better place for the value is ReplicatedStorage. Both the server and client can access it.

2 Likes