So I have this system that lists all the skins you own in a viewport thing, but it keeps trippling in an odd way, any help with this?
function update()
for _,v in pairs(player:WaitForChild("skins"):GetChildren()) do
if v.Value == true and not script.Parent.Skins.framescroll:FindFirstChild(v.Name) then
for _,t in pairs(game.ReplicatedStorage.Skins:GetChildren()) do
print("LOOOOOOK" .. v.Name)
local rr = script.TextButton:Clone()
rr.Parent = script.Parent.Skins.framescroll
rr.Name = v.Name
rr.TextLabel.Text = v.Name
viewport:rotationnviewport(t, rr.ViewportFrame, 4)
end
else
end
end
end
You are looping twice, once through the player’s skins, and for each skin in the player, you are looping through the skins in ReplicatedStorage. This is why you have 9 skins in the UI.
before doing this you need to make the things in “Skins” folder inside of ReplicatedStorage the same name as the things inside “skins” folder inside of player
if game.ReplicatedStorage.Skins:FindFirstChild(v.Name) then
print("LOOOOOOK" .. v.Name)
local rr = script.TextButton:Clone()
rr.Parent = script.Parent.Skins.framescroll
rr.Name = v.Name
rr.TextLabel.Text = v.Name
viewport:rotationnviewport(t, rr.ViewportFrame, 4)
end