I am trying to check if a attribute is 0 or 1 or all the way to 15. and then set transparency but it isnt working. how do i fix this?
FOUND OUT THAT THE TRANSPARENCY IS NOT WORKING the attrbiute detection works ok but transparency doesnt change
local Wire = script.Parent
local Strength = script.Parent.unpowered.Transparency
function setSignal()
if Wire:GetAttribute("SignalStrength") == 0 then
Strength = 0
end
if Wire:GetAttribute("SignalStrength") == 1 then
Strength = 0.0667*1
end
if Wire:GetAttribute("SignalStrength") == 2 then
Strength = 0.0667*2
end
if Wire:GetAttribute("SignalStrength") == 3 then
Strength = 0.0667*3
end
if Wire:GetAttribute("SignalStrength") == 4 then
Strength = 0.0667*4
end
if Wire:GetAttribute("SignalStrength") == 5 then
Strength = 0.0667*5
end
if Wire:GetAttribute("SignalStrength") == 6 then
Strength = 0.0667*6
end
if Wire:GetAttribute("SignalStrength") == 7 then
Strength = 0.0667*7
end
if Wire:GetAttribute("SignalStrength") == 8 then
Strength = 0.0667*8
end
if Wire:GetAttribute("SignalStrength") == 9 then
Strength = 0.0667*9
end
if Wire:GetAttribute("SignalStrength") == 10 then
Strength = 0.0667*10
end
if Wire:GetAttribute("SignalStrength") == 11 then
Strength = 0.0667*11
end
if Wire:GetAttribute("SignalStrength") == 12 then
Strength = 0.0667*12
end
if Wire:GetAttribute("SignalStrength") == 13 then
Strength = 0.0667*13
end
if Wire:GetAttribute("SignalStrength") == 14 then
Strength = 0.0667*14
end
if Wire:GetAttribute("SignalStrength") == 15 then
Strength = 0.0667*15
end
end
while true do
setSignal()
wait()
end

1 comment
like this? local Wire = script.Parent local Strength = script.Parent.unpowered.Transparency Wire:GetAttributeChangedSignal("SignalStrength"):Connect(function() Strength = 0.0667 * Wire:GetAttribute("SignalStrenth") end)