I’m trying to make a UIStroke’s Thickness be affected by the Parent’s (Frame) Background Transparency. I tried writing a script already, it didn’t work unfortunately. This is urgent as I really need it for the game to function properly.
I’m going to assume that the Background transparency is changed since the start of the game, and you were hoping the thickness would too after it was changed. But no, this script will only change the thickness whenever the game starts therefore keeping the UIStroke’s thickness the same. So, use :GetPropertyChangedSignal() and go from there.
It worked! But now, the Frame’s Background Transparency is 0, which also makes the Thickness 0. Before the script I made both the Background Transparency of the frame and the Thickness for the UIStroke 0.5, so it could look cooler.
Now the UIStroke only appears when the Frame’s BackgroundTransparency is 1, which also makes the UiStroke Thickness 0.
Sorry for all the words, hopefully this can be fixed as it makes the game really good.
Is there a way that you can make it so that when the Frame’s
BT (BackgroundTransparency) is 0, the UIStroke’s Thickness is 0.5, & when the Frame’s BT is 1, the UiStroke’s Thickness is 0?
local UIStroke = script.Parent.UIStroke
script.Parent:GetPropertyChangedSignal("BackgroundTransparency"):Connect(function()
local transparency = script.Parent.BackgroundTransparency
if transparency = 0 then
UIStroke.Thickness = .5
elseif transparency = 1 then
UIStroke.Thickness = 0
end
end)
Sorry for the late response (I was playing a game lol)