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

How can I make blocks appear at night?

Asked by 4 years ago

My main goal is for specific parts on a building to become visible when the time is around 18 in the clock time and then become transparent (not-visible) when the clock time is around 6.1,

Is this possible in anyway?

0
You can maybe using Lighting and use greater than and less than? I'll send a script with an answer in a minute or two.. crousei 2 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Here you go. Hope this works.

local part = game.Workspace.Part

while true do
    local hour = tonumber(string.sub(game.Lighting.TimeOfDay,1,2))
    local dark = false
    if hour <= 6.1 or hour >= 18 then
        dark = true
    end
    if dark == true then
        part.Transparency = 0
    end
    if dark == false then
        part.Transparency = 1
    end
end
0
this script will break right after starting as while loop without debounce will run with speed of light causing it to break, add debounce to it. imKirda 4491 — 4y
0
you forgot to add a wait(), so it wont work :) FirewolfYT_751 223 — 4y
Ad

Answer this question