Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Trying to change the decal ID while playing?

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

✓ Accepted answer

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.

2 comments

0

Many thanks! it solved the problem

0

No problem!

This discussion is preserved as it was. New answers, comments, and votes are closed.