|
| 05 May 2017 02:19 AM |
stole it from the wiki and edited a bit.
lightPart = game.Workspace.LightPart minutesAfterMidnight = 0 while true do minutesAfterMidnight = minutesAfterMidnight + 10 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1) if game.Lighting:GetMinutesAfterMidnight() == 6 * 60 then -- checks for 6AM script.Parent.Material = Enum.Material.Plastic end if game.Lighting:GetMinutesAfterMidnight() == 18 * 60 then -- checks for 6PM script.Parent.Material = Enum.Material.Neon
end end
|
|
|
| Report Abuse |
|
|
Dankvisky
|
  |
| Joined: 04 Mar 2012 |
| Total Posts: 5430 |
|
|
| 05 May 2017 03:55 AM |
lightPart = game.Workspace.LightPart minutesAfterMidnight = 0
while true do minutesAfterMidnight = minutesAfterMidnight + 10 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1)
if game.Lighting:GetMinutesAfterMidnight() == 6 * 60 then -- checks for 6AM lightPart.Material = Enum.Material.Plastic end
if game.Lighting:GetMinutesAfterMidnight() == 18 * 60 then -- checks for 6PM lightPart.Material = Enum.Material.Neon
end end
|
|
|
| Report Abuse |
|
|
|
| 05 May 2017 01:37 PM |
| I want many lightparts so I want to change it to parent I have no problem with that but when I play I get a weird error. |
|
|
| Report Abuse |
|
|
iReIix
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 5175 |
|
|
| 05 May 2017 01:46 PM |
add else
then add prints to check
|
|
|
| Report Abuse |
|
|
|
| 05 May 2017 01:49 PM |
| Why not you do the work and then tel me because I don't have time to read and educate myself on that. |
|
|
| Report Abuse |
|
|
| |
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 05 May 2017 02:24 PM |
"Why not you do the work i dont have time to read and educate myself."
(◉ ͜ʖ◉) Boi.
|
|
|
| Report Abuse |
|
|
Calviski
|
  |
| Joined: 03 Dec 2016 |
| Total Posts: 209 |
|
|
| 05 May 2017 02:30 PM |
then leave seal
we've educated ourselves, learned Lua ourselves
go away |
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 05 May 2017 02:34 PM |
Honestly, if you can't read your own damn output and realize that it tells you exactly what the problem is, scripting may not be for you.
All I did was remove the first line since that part obviously doesn't exist if you're using Parent, move the script under a brick, and add a little modulo because having an infinitely growing variable is dangerous.
minutesAfterMidnight = 0 while true do minutesAfterMidnight = (minutesAfterMidnight + 10)%1440 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1) print(minutesAfterMidnight) if game.Lighting:GetMinutesAfterMidnight() == 6 * 60 then -- checks for 6AM script.Parent.Material = Enum.Material.Plastic end if game.Lighting:GetMinutesAfterMidnight() == 18 * 60 then -- checks for 6PM script.Parent.Material = Enum.Material.Neon
end end
|
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 05 May 2017 03:22 PM |
@Cal you're not the one to talk cause your posting forums on how to "make a gui go away" lol.
#Code print("Look behind you huehuehuehue") |
|
|
| Report Abuse |
|
|
Calviski
|
  |
| Joined: 03 Dec 2016 |
| Total Posts: 209 |
|
|
| 05 May 2017 04:08 PM |
@spiny
I'm a beginner, and atleast I'm bothering to learn it, unlike OP. |
|
|
| Report Abuse |
|
|
|
| 06 May 2017 06:21 PM |
My output showed something like
"Attempt to connect failed: Passed value is not a function"
But thanks if that works I'd be happy.
|
|
|
| Report Abuse |
|
|
|
| 06 May 2017 06:22 PM |
I also do read my output I'm not stupid or anything like you thinking I don't read my output.
|
|
|
| Report Abuse |
|
|
|
| 06 May 2017 06:24 PM |
Still the same result with your dumb script .
|
|
|
| Report Abuse |
|
|
|
| 06 May 2017 06:26 PM |
Well thanks anyways since I am still tired and don't know what I am doing.
I could not sleep since of the heat for a few nights.
|
|
|
| Report Abuse |
|
|
ahwz
|
  |
| Joined: 01 Apr 2010 |
| Total Posts: 3230 |
|
|
| 06 May 2017 06:28 PM |
your error has nothing to do with that script
"Attempt to connect failed: Passed value is not a function"
check your ":Connect"'s if you do something like part.Touched:Connect(func()) you'll get that same error.
|
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 06 May 2017 06:37 PM |
My script has nothing to do with making connections. Your console error is coming from another 'dumb script' of yours.
|
|
|
| Report Abuse |
|
|
|
| 06 May 2017 06:39 PM |
It's not your script really.
It was my other scripts in studio well sorry bout' your temper tantrums.
|
|
|
| Report Abuse |
|
|
| |
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
| |
|
|
| 06 May 2017 06:45 PM |
I was but sometimes I am addicted to the computer, thanks for the reminder. I think you should too.
|
|
|
| Report Abuse |
|
|
|
| 06 May 2017 06:49 PM |
Thanks for the anger, that totally helped even though your dumb script was the same thing.
|
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
| |
|
Inductive
|
  |
| Joined: 28 May 2012 |
| Total Posts: 6480 |
|
|
| 06 May 2017 07:01 PM |
There's actually no need to check if it's 6 AM or 6 PM, because you already know the minutes so it's redundant.
You could alter the script like this to remove those checks:
minutesAfterMidnight = 0 while true do for i = 1, 36 do minutesAfterMidnight = (minutesAfterMidnight + 10)%1440 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1) print(minutesAfterMidnight) end script.Parent.Material = Enum.Material.Plastic -- It is 6 AM for i = 1, 72 do minutesAfterMidnight = (minutesAfterMidnight + 10)%1440 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1) print(minutesAfterMidnight) end script.Parent.Material = Enum.Material.Neon --It is 6 PM for i = 1, 36 do minutesAfterMidnight = (minutesAfterMidnight + 10)%1440 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1) print(minutesAfterMidnight) end end
Alternatively, you could condense the loops by having the script start at 6:AM.
minutesAfterMidnight = 360 while true do for i = 1, 72 do minutesAfterMidnight = (minutesAfterMidnight + 10)%1440 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1) print(minutesAfterMidnight) end script.Parent.Material = Enum.Material.Neon -- It is 6 AM for i = 1, 72 do minutesAfterMidnight = (minutesAfterMidnight + 10)%1440 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) wait(0.1) print(minutesAfterMidnight) end script.Parent.Material = Enum.Material.Plastic --It is 6 PM end
While it's a bit disappointing that people would be mad at you for basically wanting to learn, saying "I don't have time to read, please do this for me" is really not a good way to get people to help you, especially on this forum. Anyway, have fun. |
|
|
| Report Abuse |
|
|
|
| 07 May 2017 06:10 AM |
Don't mind OP, its a known idiot lol
|
|
|
| Report Abuse |
|
|