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

Trying to change the decal ID while playing?

Asked by
Roytt 64
8 years ago

This script just places the number id inside the decal but the decal is not shown, any help?

function event.OnServerInvoke(player,id,color)
    local prefix ="rbxassetid://"
    local color = BrickColor.new(color)
    local image = (prefix..id)
    local parts = workspace.Banners:GetChildren()
    if color then
    for i,v in pairs(parts) do
        if v.Name == "Cloth" then
            v.BrickColor = color
        elseif v.Name == "Crest" then
            v.Decal.Texture = id
        end
    end
    else return "Invalid Color!"
    end
    return "Banner set!"
end

1 answer

Log in to vote
2
Answered by
Decemus 141
8 years ago
Edited 8 years ago

The first problem I noticed was that you did v.Decal.Texture = id. It might be best that you do v.Decal.Texture = image instead. Sometimes it might not work right. In addition, make sure your IDs are textures and not decals. To figure that out, you can usually subtract one from the ID on your brower or more than one until you find the texture. I didn't see anything else other than that your tabbing isn't that perfect. Just to suggest, tabbing can prevent some problem with end and such.

0
Many thanks! it solved the problem Roytt 64 — 8y
0
No problem! Decemus 141 — 8y
Ad

Answer this question