Starter is not a valid member of Folder "Players.Official_ProGamerYT.Packs"

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?

I want to achieve a working shop system,

  1. What is the issue?


image

  1. What solutions have you tried so far?

Finding a solution.

while wait() do
	if game.Players.LocalPlayer.Packs[script.Parent.Parent.Parent.Parent.ItemFrame.SelectedPack.Value].Value == true then
		script.Parent.Visible = true
	else
		script.Parent.Visible = false
	end
end

Thank you in advance.

Inside the loop, you can check if it exists or wait for it to exist

Check
local Player = game:GetService("Players").LocalPlayer
while task.wait() do
	local ToFind = script.Parent.Parent.Parent.Parent.ItemFrame.SelectedPack.Value
	local V = Player:FindFirstChild("Packs") and Player.Packs:FindFirstChild(ToFind)
	script.Parent.Visible = (V and V.Value) or false
end

Source: Instance:FindFirstChild()

Wait
local Player = game:GetService("Players").LocalPlayer
while task.wait() do
	local ToFind = script.Parent.Parent.Parent.Parent.ItemFrame.SelectedPack.Value
	local V = Player:WaitForChild("Packs"):WaitForChild(ToFind)
	script.Parent.Visible = V.Value
end

Source: Instance:WaitForChild()

But it’s better to use Changed, instead of a loop

local Player = game:GetService("Players").LocalPlayer
local ToFind = script.Parent.Parent.Parent.Parent.ItemFrame.SelectedPack.Value
local V = Player:WaitForChild("Packs"):WaitForChild(ToFind)

function Update(Value:boolean)
	script.Parent.Visible = Value
end
V.Changed:Connect(Update)		Update(V.Value)

I think your problem is that you need to use WaitForChild() to make sure that everything is loaded in. Try this:

while wait() do
	if game.Players.LocalPlayer:WaitForChild(Packs):WaitForChild([script.Parent.Parent.Parent.Parent.ItemFrame.SelectedPack.Value]).Value == true then
		script.Parent.Visible = true
	else
		script.Parent.Visible = false
	end
end

Thank you so much this helped a lot

local player = game.Players.LocalPlayer

while task.wait() do
	if player:WaitForChild("Packs")[script.Parent.Parent.Parent.Parent.ItemFrame.SelectedPack.Value].Value then
		script.Parent.Visible = true
	else
		script.Parent.Visible = false
	end
end