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

Help with removing textures from certain parts only?

Asked by 6 years ago

so I have a script and I want it to only remove textures from certain parts

--Var
--Script

for i, part in ipairs(workspace:GetChildren()) do
        if part.ClassName == "Part" then
        --Smooth Parts
        if part.TopSurface == "Weld" then
            part.TopSurface = "Weld"
        end

        if part.TopSurface == "SmoothNoOutlines" then
            part.TopSurface = "SmoothNoOutlines"
        end

        if part.TopSurface == "Hinge" then
            part.TopSurface = "Hinge"
        end

        if part.TopSurface == "Motor" then
            part.TopSurface = "Motor"
        end

        if part.TopSurface == "Glue" then
            part.TopSurface = "Glue"
        end

        if part.TopSurface == "Studs" then
            part.TopSurface = "Smooth"
        end

        if part.BottomSurface == "Weld" then
            part.BottomSurface = "Weld"
        end

        if part.BottomSurface == "Hinge" then
            part.BottomSurface = "Hinge"
        end

        if part.BottomSurface == "Motor" then
            part.BottomSurface = "Motor"
        end

        if part.BottomSurface == "Glue" then
            part.BottomSurface = "Glue"
        end

        if part.BottomSurface == "Inlet" then
            part.BottomSurface = "Smooth"
        end

            if part.BottomSurface == "Smooth" then
            part.BottomSurface = "SmoothNoOutlines"
        end

        part.Material = "SmoothPlastic"
        --Circle Studs Top
        local s = Instance.new("Texture")       
        s.Face = "Top"
        s.StudsPerTileU = 2
        s.StudsPerTileV = 2
        s.Parent = part
        s.Texture = "rbxassetid://161779908"
        --Circle Studs Bottom
        local s2 = Instance.new("Texture")
        s2.Face = "Bottom"
        s2.StudsPerTileU = 2
        s2.StudsPerTileV = 2
        s2.Parent = part
        s2.Texture = "rbxassetid://161779906"
        --Old Skybox
        local sky = script.Parent.Sky:Clone()
        sky.Parent = game.Lighting
        --Old Lighting
        game.Lighting.GlobalShadows = false
        game.Lighting.Ambient = Color3.fromRGB(165, 165, 165)
        game.Lighting.OutdoorAmbient = Color3.fromRGB(197, 197, 197)

        --Remove texture from spheres

        for i, part in ipairs(workspace:GetChildren()) do
        if part.ClassName == "Part" then
        if part.Shape == "Ball" then
        for i, texture in ipairs(workspace:GetChildren()) do            
            if texture.ClassName == "Texture" then
                texture:Remove()
            end
            end
            end
        end 
        end
        end
    end

any help is appreciated :)

0
Lines 4 ~ 53 Why are you using that? This don't does nothing! Leamir 3138 — 6y
0
Because if i don't it makes the surfaces smooth and removes the other ones making certain things like welds hinges or motors broken VeryDarkDev 47 — 6y

Answer this question