DevKonner
|
  |
| Joined: 04 Feb 2012 |
| Total Posts: 519 |
|
|
| 05 Jun 2015 12:37 PM |
if game.Lighting.TimeOfDay == 18 then script.Parent.BrickColor = "Cool Yellow" and script.Parent.SurfaceLight.Enabled == true end
That isnt working if the TimeOfDay is 18:00:00 |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2015 12:41 PM |
You said it yourself.
if game.Lighting.TimeOfDay == "18:00:00" then |
|
|
| Report Abuse |
|
|
DevKonner
|
  |
| Joined: 04 Feb 2012 |
| Total Posts: 519 |
|
|
| 05 Jun 2015 12:44 PM |
Its still not working and all I have is this inside of a script
if game.Lighting.TimeOfDay == "18:00:00" then script.Parent.BrickColor = "Cool Yellow" and script.Parent.SurfaceLight.Enabled == true end |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2015 12:56 PM |
script.Parent.BrickColor = "Cool Yellow" and script.Parent.SurfaceLight.Enabled == true
Should be: script.Parent.BrickColor = BrickColor.new("Cool Yellow") script.Parent.SurfaceLight.Enabled = true ---------------------
== is for comparisons (is A equal to B) = is for assigning (Set A to B) |
|
|
| Report Abuse |
|
|
DevKonner
|
  |
| Joined: 04 Feb 2012 |
| Total Posts: 519 |
|
|
| 05 Jun 2015 01:08 PM |
Alright. So I got this now and it still is not working :/
if game.Lighting.TimeOfDay == "18:00:00" then script.Parent.BrickColor = BrickColor.new("Cool Yellow") script.Parent.SurfaceLight.Enabled = true end
when i remove 1 '=' from line 1 it gives me a red underline under the one '=' in line one |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 05 Jun 2015 01:12 PM |
| This code runs once, it does not constantly check. |
|
|
| Report Abuse |
|
|
Sebrights
|
  |
| Joined: 02 Feb 2011 |
| Total Posts: 5580 |
|
|
| 05 Jun 2015 01:13 PM |
OOh, your problem is that "Cool Yellow" isn't a color, it should be "Cool yellow" notice the capital you added.
-The name's Sebright. |
|
|
| Report Abuse |
|
|
DevKonner
|
  |
| Joined: 04 Feb 2012 |
| Total Posts: 519 |
|
|
| 05 Jun 2015 01:19 PM |
| I tried that and it still doesnt work |
|
|
| Report Abuse |
|
|
| |
|
DevKonner
|
  |
| Joined: 04 Feb 2012 |
| Total Posts: 519 |
|
|
| 05 Jun 2015 01:22 PM |
| I think I know whats going on. When its at 18:00:00 it turns on then it turns off. How do I make it go until like 5:00:00? |
|
|
| Report Abuse |
|
|
DevKonner
|
  |
| Joined: 04 Feb 2012 |
| Total Posts: 519 |
|
| |
|
|
| 05 Jun 2015 02:03 PM |
if game.Lighting.TimeOfDay == 18:00:00 then script.Parent.BrickColor = "Cool yellow" and script.Parent.SurfaceLight.Enabled = true then if game.Lighting.TimeOfDay == 5:00:00 then script.Parent.SurfaceLight.Disabled = true end end end) |
|
|
| Report Abuse |
|
|
DevKonner
|
  |
| Joined: 04 Feb 2012 |
| Total Posts: 519 |
|
|
| 05 Jun 2015 02:29 PM |
| What will that do? From my understandings it turns on at 18:00:00 then turns off at 18:00:01 because it says when the time of say is 18:00:00 nt like 18:00:00 through 5:00:00 |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2015 02:40 PM |
while true do if game.Lighting.TimeOfDay == ("18:00:00") then script.Parent.BrickColor = ("Cool yellow") script.Parent.SurfaceLight.Enabled = true end end |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2015 02:41 PM |
while true do if game.Lighting.TimeOfDay == ("18:00:00") then script.Parent.BrickColor = ("Cool yellow") script.Parent.SurfaceLight.Enabled = true wait() elseif game.Lighting.TimeOfDay == ("5:00:00")then script.Parent.SurfaceLight.Enabled = false end end end |
|
|
| Report Abuse |
|
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 05 Jun 2015 03:34 PM |
script.Parent.SurfaceLight.Enabled = true
with one = not 2 |
|
|
| Report Abuse |
|
|
DevKonner
|
  |
| Joined: 04 Feb 2012 |
| Total Posts: 519 |
|
| |
|
v3c3
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 674 |
|
|
| 06 Jun 2015 11:19 AM |
@amanda literally just told you what was wrong with your script.
It needs to check constantly. |
|
|
| Report Abuse |
|
|
| |
|
Luminak
|
  |
| Joined: 27 May 2012 |
| Total Posts: 2809 |
|
|
| 06 Jun 2015 02:46 PM |
script.Parent.BrickColor = "Cool Yellow" you can't say that you have to sayu script.Parent.BrickColor = BrickColor.new("Cool yellow") |
|
|
| Report Abuse |
|
|