So I'm helping my friend make this prison game, and I'm trying to make this door transparent and not collidable at 8AM, then not transparent and collidable at 9PM. I wrote out the script, but it doesn't seem to be working. I already have a day/night cycle.
Here is the code for the transparent maker. The thing going transparent is a union.
local door = script.Parent
if game.Lighting:GetMinutesAfterMidnight() == 8*60 then
door.Transparency = 1
door.CanCollide = false
end
if game.Lighting:GetMinutesAfterMidnight() == 21*60 then
door.Transparency = 0
door.CanCollide = true
end
Here is my day/night cycle. (I don't think this is the issue tbh, just putting it here because it might be helpful to others!)
local interval = 0.4
local change = 0.5
while wait(interval) do
game.Lighting.ClockTime = game.Lighting.ClockTime + change
end
Any help is appreciated!

1 comment
thank you! it worked!