Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I make blocks appear at night?

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?

1 comment

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..

1 answer

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

2 comments

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.

0

you forgot to add a wait(), so it wont work :)

This discussion is preserved as it was. New answers, comments, and votes are closed.