Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Looped texture creation issue?

Asked by 8 years ago

The code runs fine and dandy but only creates the a "Left" and "Bottom" texture for each part, not all faces. No idea whats causing this

local textures = {
    ["http://www.roblox.com/asset/?id=288853368"] = Enum.NormalId.Top;
    ["http://www.roblox.com/asset/?id=288853368"] = Enum.NormalId.Bottom;
    ["http://www.roblox.com/asset/?id=288853365"] = Enum.NormalId.Front;
    ["http://www.roblox.com/asset/?id=288853365"] = Enum.NormalId.Back;
    ["http://www.roblox.com/asset/?id=288853365"] = Enum.NormalId.Right;
    ["http://www.roblox.com/asset/?id=288853365"] = Enum.NormalId.Left;
};


function search(dir)
    for _, part in pairs(dir:GetChildren()) do
        if part:IsA("BasePart") and part.ClassName ~= "Terrain" then
            if part.Material == Enum.Material.Concrete then
                for id, enum in pairs(textures) do
                    local tex = Instance.new("Texture", part);
                    tex.Face = enum;
                    tex.Texture = id;
                    tex.StudsPerTileV = 8;
                    tex.StudsPerTileU = 8;
                end
            end
        else
            search(part);
        end
    end
end

search(workspace);
0
Are you sure the textures aren't being created? Maybe they're just invisible because of moderation/internet BlueTaslem 18071 — 8y

Answer this question