so im making an obby and im making a script for a fading part. i thought it would work but it doesnt and now i have no idea how to get it to work.
(fade is an IntValue)
local fade = script.Parent.fade
local fadeAmount = 0.05
local fadeTime = 0.5
local part = script.Parent
part.Touched:Connect(function(hit)
while true do
wait(fadeTime)
fade.Value = fade.Value + fadeAmount
part.Transparency = fade
if fade == 1 then
part.CanCollide = false
end
end
end)

2 comments
Do you want it to check if fade is above 1? or that it fades or both?
no i need to check if fade is 1 because thats when the transparency of the block goes invisible