Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make this union transparent at a certain time?

Asked by 6 years ago

So, I first wanted to make a union collapse (shrink) upwards. Unfortunately, I am very new to scripting and I have no idea how to do that. So I settled for trying to make the union transparent at a certain time. I have a slight understanding of code, and I took the code from the street light tutorial, and tried changing it so that it would only change the transparency.

ClosedMetal = game.Workspace.ClosedMetal

while true do minutesAfterMidnight = minutesAfterMidnight + 10 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1)

if game.Lighting:GetMinutesAfterMidnight() == 20 * 60 then      -- checks for 9PM
    ClosedMetal.Transparency = 1
end
if game.Lighting:GetMinutesAfterMidnight() == 7 * 60 then       -- checks for 6AM
    ClosedMetal.Transparency = 0
end

end This is the code I have attached to the union.

Answer this question