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

Why doesn't my script work? (Decal image pasted on every surface of a part in workspace.)

Asked by 3 years ago

So I'm making a little joke map for a friend of mine. The script I've created is supposed to find any baseparts, which in return pastes a decal on every surface of said parts.

However, the script being enabled, doesn't do anything nor gives me any error in the output. What is going on?

for _, v in pairs(workspace:GetDescendants()) do
    if v:IsA("BasePart") or v:IsA("UnionOperation") then
        do
        for i = 0, 5 do
            local decal = Instance.new("Decal")
            decal.Texture = "rbxassetid://6255641236"
            decal.Face = i
            decal.Parent = v
           end
        end
    end
end
0
maybe you have to do :WaitForChild() shieldmr3 2 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Your decal texture was improper. Here is an updated script with your decal image you wanted to appear.

for _, v in pairs(workspace:GetDescendants()) do
    if v:IsA("BasePart") or v:IsA("UnionOperation") then
        do
            for i = 0, 5 do
                local decal = Instance.new("Decal")
                decal.Texture = "http://www.roblox.com/asset/?id=6255641229"
                decal.Face = i
                decal.Parent = v
            end
        end
    end
end
Ad

Answer this question