star = game.Workspace.Stars.Star
minutesAfterMidnight = 0
if game.Lighting:GetMinutesAfterMidnight() == 6 * 60 then -- checks for 6AM
star.Script.Disabled = false
end
if game.Lighting:GetMinutesAfterMidnight() == 18 * 60 then -- checks for 6PM
star.Script.Disabled = true
end
end
This is a script that checks for the time of day, and then enables/disables a script inside other parts depending on the time of day. If it means anything, it works alongside a day/night script that looks a little like this-
minutesAfterMidnight = 0
while true do
minutesAfterMidnight = minutesAfterMidnight + 1
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(.1)
end
I don't know if I should merge these two scripts into one or not. It's a huge mess.
It doesn't work (obviously since I'm the one who's handling it), and I think I have my problems sorted out, but I don't know how to solve them.
Problem 1. I'm not referring to the light scripts correctly.
Problem 2. I don't know how to refer to multiple items at once. (There's 10 stars, meaning 10 scripts to enable/disable)
Thanks in advance.

1 comment
Check out this link: http://wiki.roblox.com/index.php?title=Global_namespace/Basic_functions&redirect=no#pairs. It basically shows how to get 1 item from a table using only a single script. So a tip would be to put all the star/lights inside of a folder or model and use GetChildren to return a table with all those stars. Then you'd use pairs.