#im trying to solve a bug that clones skins in the inventory, i dont know how

1 messages · Page 1 of 1 (latest)

olive viper
#

if player.EquippedSkin.Value == skin.Name then
script.Parent.Buy.Equip.Text = "Equipped"
else
script.Parent.Buy.Equip.Text = "Equip"
end
end

function load()
for i, v in pairs(player.SkinInventory:GetChildren()) do
if game.ReplicatedStorage.Skins:FindFirstChild(v.Name) ~= nil then
local skin = game.ReplicatedStorage.Skins:FindFirstChild(v.Name)
local template = script.Template:Clone()
template.Parent = script.Parent.Skins
template.Name = skin.Name
template.TextLabel.Text = ""
template.Image = skin.HumanoidRootPart.o.y.Image
sodiumChloride(skin)

        template.MouseButton1Click:Connect(function()
            script.Parent.Buy.SkinImage.Image = template.Image
            script.Parent.Buy.Desc.Text = skin.Description.Value
            script.Parent.Buy.Title.Text = skin.Name
            sodiumChloride(skin)
            
            script.Parent.Buy.Equip.MouseButton1Click:Connect(function()
                if player.EquippedSkin.Value ~= skin.Name then
                    game.ReplicatedStorage.BuyItem:InvokeServer(skin.Name, "skin")
                    sodiumChloride(skin)
                end
            end)
        end)
    end
end

end

script.Parent.Parent.InventoryToggle.MouseButton1Click:Connect(load)