Decal transparency not changing from a script

For some reason when i change a decals transparency inside a script it does nothing but works when i change in-game manually.

-------creating part inside player (Did not include property changes: size, position, color, etc)--------------

 local Accessory = Instance.new("Accessory")
				Accessory.Parent = char
				Accessory.Name = "HandCuffs"
				local Handle = Instance.new("Part")
				Handle.Parent = Accessory

-------------Here is where it doesnt work------------------------------------

	local decal1 = Instance.new("Decal")
			decal1.Transparency = 0 -- **DOESNT CHANGE ITS TRANSPARENCY**
			decal1.Color3 = Color3.new(255, 255, 255)			
			decal1.Parent = char:WaitForChild("HandCuffs").Handle
			decal1.Texture = "http://www.roblox.com/asset/?id=(Not included for privacy)"
			decal1.Transparency = 0 -- **DOESNT CHANGE ITS TRANSPARENCY**
---------------------------------------------------------------------------------------

image

2 Likes

There’s nothing wrong with the script but I think you should ALWAYS set the parent first then fill in the details of an instance.

E.g

Instance.new("Decal", Workspace)

or

local d = Instance.new("Decal")
d.Parent = Workspace

You should be doing the opposite. Setting the parent first is slower.

hey guys im trying to find a propery similar to offset in meshes but in a part. what property should i use?

the thing about position is its not relative to the current position it just brings it to that location in workspace. however offset in meshes dont put it in that location in workspace but add it to the current meshes position. i tried doing a math equation to replace the function but it sometimes didnt work

For example \

PartOffset = Part.Position + vector3.new(Insert Offset Position)

however it sometimes breaks. (this is becuase the character is moving around and can mess it up based on orientation)

call it a different name? it’s the only solution i can think of

Go to Properties hit the thing you want to change the transparency search it up, And match the transparency with the script. If this doesn’t work that just means i’m stupid.

Decals may be broken, as they are invisible (for me at least) even though they have a transparency of 0.

How would that relate here? They’re trying to set the decal to visible.

Ah, I see, I didn’t really pay attention to the decal1.Transparency = 0. (thought they attempted to make the background transparency invisible)

Sorry

If you need the part to retain its orientation then you should be manipulating its CFrame property instead.

part.CFrame += Vector3.new(0, 0, -5) for example.

i was using a mesh and the mesh messed with the images visibility.

Great work! I would never have thought that lol that proves you’re smarter XD. (I’m not saying you’re dumb/stupid btw)