I cant make instance in folder

i literaly cant make a instance. if i take out this line:

				local instac2 = Instance.new("StringValue")
				instac2.Parent = aaa
				instac2.Value = skinselect.Value
				instac2.Name = skinselect.Name

everything on that for loop works fine, but no, there no nothing, you cant test this out, and no there no errors on the output, it should work but idk why isnt.

	local cccccccc = coroutine.wrap(function(ee)
		local dataFolder : Folder = ee:WaitForChild("DataFolder")
		local currentSkin : Folder = dataFolder:WaitForChild("CurrentSkin")
		local aaa : Folder = dataFolder:WaitForChild("EquiptSkins")
		print(dataFolder:GetChildren())
		
		for _, v in currentSkin:GetChildren() do
			if v:IsA("StringValue") and v.Name ~= skinselect.Value then
				v:Destroy()
				print("aaadko,dwadwdeimkonjhlikounjhl")
				local instac = Instance.new("StringValue", currentSkin)
				instac.Name = skinselect.Value
				instac.Value = skinselect.Value
			else
				print("aaadko,adewasdadwadwadwawadsdaasdasasasdaasdasdasd")
				v.Name = skinselect.Value
				v.Value = skinselect.Value
			end
		end

		for _, v in aaa:GetChildren() do
			if v:IsA("StringValue") and v.Name == skinselect.Name then
				v.Name = skinselect.Name
				v.Value = skinselect.Value
				print("ionjlknjkonjlmkoñmkpñ")
			else
				print("iojhbikuj-biuyñ-biuyjhb jh")
				local instac2 = Instance.new("StringValue")
				instac2.Parent = aaa
				instac2.Value = skinselect.Value
				instac2.Name = skinselect.Name
			end
		end
	end)
	cccccccc(player)
	sessiondata[player.UserId].CurrentSkin = skinselect.Value -- more data stuff

	player:LoadCharacter()
	task.wait(1)
	print(sessiondata[player.UserId] -- data stuff

Disable the coroutine.wrap() line and just set ccccccc = function(ee)
I haven’t used coroutines in a while but if I remember right it masks any script errors similar to how pcall() functions
You are likely still getting an error but it’s being hidden by coroutine.wrap

My guess is attempted to index nil with Value because skinselect was never defined

first the index is difined, is a argument on a remote event, third i try that but agh ig im wanna do it again anyways

i change it but doesnt still not working:

game:GetService("ReplicatedStorage").Folder.SkinSelect.OnServerEvent:Connect(function(player, skinselect: StringValue)
	
	local ccccccc = function(ee)
		local dataFolder : Folder = ee:WaitForChild("DataFolder")
		local currentSkin : Folder = dataFolder:WaitForChild("CurrentSkin")
		local aaa : Folder = dataFolder:WaitForChild("EquiptSkins")
		print(dataFolder:GetChildren())
		
		for _, v in currentSkin:GetChildren() do
			if v:IsA("StringValue") and v.Name ~= skinselect.Value then
				v:Destroy()
				print("aaadko,dwadwdeimkonjhlikounjhl")
				local instac = Instance.new("StringValue", currentSkin)
				instac.Name = skinselect.Value
				instac.Value = skinselect.Value
			else
				print("aaadko,adewasdadwadwadwawadsdaasdasasasdaasdasdasd")
				v.Name = skinselect.Value
				v.Value = skinselect.Value
			end
		end

		for _, v in aaa:GetChildren() do
			if v:IsA("StringValue") and v.Name == skinselect.Name then
				v.Name = skinselect.Name
				v.Value = skinselect.Value
				print("ionjlknjkonjlmkoñmkpñ")
			else
				print("iojhbikuj-biuyñ-biuyjhb jh")
				local instac2 = Instance.new("StringValue")
				instac2.Parent = aaa
				instac2.Value = skinselect.Value
				instac2.Name = skinselect.Name
			end
		end
	end
	ccccccc (player)
	sessiondata[player.UserId].CurrentSkin = skinselect.Value

	player:LoadCharacter()
	task.wait(1)
	print(sessiondata[player.UserId])
end)

Ok, I see. You also forgot to set the parent of instac. Try adding:

instac.Parent = aaa

when you making a instance, there 2 methods on putting a parent:

local new = Instance.new("Part", aaa)

and the one you telling, but even that doesnt fix, i try the 2 methods, and doesnt work

Your code should work. I don’t see any other issues with it.

You need to give more information. How many of the print statements do you see? Show your output log

Something is wrong with your setup, but I would need to see more of your code. Some potential problems:

  • multiple SkinSelect remote events
  • duplicate Folder.SkinSelect objects
  • mispellings, like “EquiptSkins”
  • bad variables names that confused you (ee, cccccc, aaa, etc)
  • you could be getting an “Infinite Yield” warning for one of your :WaitForChild()
External Media

i record this to show