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**
---------------------------------------------------------------------------------------
2 Likes
yyumchi
(ăă¸ă)
March 29, 2022, 12:18am
#2
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
loudbytes
(loudbytes)
March 29, 2022, 12:30am
#3
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.
loudbytes
(loudbytes)
March 29, 2022, 4:20am
#9
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
Forummer
(Forummer)
March 29, 2022, 4:38am
#11
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)