Value not loading right

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 have a gui frame cloned when a value in my folder changes

  2. **What is the issue? four items in the folder change but only three clone

  3. **What solutions have you tried so far? I’ve tried if the value equals more than 0.
    any help is welcome!

local invframe = script.Parent.Inv
local handler = invframe.InvFrame

local temp = script:WaitForChild("Item")

local Items = game.Players.LocalPlayer:WaitForChild("Folder_name")


for i,v in pairs(Items:GetChildren()) do
	v:GetPropertyChangedSignal("Value"):Connect(function()
				local NewItem = temp:Clone()
		NewItem.Parent = handler
	
	 

	end)

	
end

Thanks for reading!

It could be because the final value is being added after the connections are made, so you could try doing adding something like:

items.ChildAdded:Connect(function(newChild)
    newChild:GetPropertyChangedSignal('Value'):Connect(function()
        local NewItem = temp:Clone()
		NewItem.Parent = handler
    end)
end)
2 Likes

I forgot to mention that in the folder there are ten values, when a player loads the values change because its a players inventory loading in.

So mine is loading 4 meaning I have 4 items.