How to make something check when something has happened

so i have a part called check part. I have another part called part. There is a script in check part:

wait(5)
script.Parent.Transparency = 1

there is also a script in part:

local Check = game.workspace.CheckPart
if Check.Transparency == 1 then
    script.Parent.Transparency = 1
end

But for some reason it does not work.

Use :GetPropertyChangedSignal(), it’ll fire when said property is changed:

local Check = game.workspace.CheckPart

Check:GetPropertyChangedSignal("Transparency"):Connect(function()
if Check.Transparency == 1 then
    script.Parent.Transparency = 1
end
end)
1 Like