|
| 10 Jul 2013 11:15 AM |
Am I just....over looking something? They're ALWAYS Collidable..
game.Lighting.Changed:connect(function() local x = game.Lighting:GetMinutesAfterMidnight() if x > 360 then A.CanCollide = true B.CanCollide = true C.CanCollide = true D.CanCollide = true E.CanCollide = true elseif x > 1080 then A.CanCollide = false B.CanCollide = false C.CanCollide = false D.CanCollide = false E.CanCollide = false end end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Jul 2013 11:19 AM |
| Once it changes keep printing x to see if it actually even reach more than 1080. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:20 AM |
I'm a noob at scripting but...(check the side note)
game.Lighting.Changed:connect(function() local x = game.Lighting:GetMinutesAfterMidnight() if x > 360 then A.CanCollide = true B.CanCollide = true C.CanCollide = true D.CanCollide = true E.CanCollide = true -- do you need an end after this line? elseif x > 1080 then A.CanCollide = false B.CanCollide = false C.CanCollide = false D.CanCollide = false E.CanCollide = false end end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Jul 2013 11:21 AM |
| Also maybe because if the minutes is under 360, the script has no idea what to do. more I look at it, it only checks it once, make it a loop |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:23 AM |
| Changed is basically a loop, but it only fires once something... Well... Changes. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Jul 2013 11:26 AM |
| Actually try a while loop instead. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:31 AM |
Tried it.....no difference. :S
I'm really confused though, this has NEVER happened for me before. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:31 AM |
I think I got it. Logic error. It won't execute the > 1080 thingy because the >360 is before it. So lets say it is 1090 minutes, and it runs the first if, (the > 360) it runs it, and everything is true, and ignores the > 1080
|
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:32 AM |
game.Lighting.Changed:connect(function() local x = game.Lighting:GetMinutesAfterMidnight() if x > 360 then -- will execute even if x is 1090. because it is still over 360. A.CanCollide = true B.CanCollide = true C.CanCollide = true D.CanCollide = true E.CanCollide = true elseif x > 1080 then -- because the first if was executed, it ignores this. A.CanCollide = false B.CanCollide = false C.CanCollide = false D.CanCollide = false E.CanCollide = false end end) |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:33 AM |
Switching the two if statements should fix it
game.Lighting.Changed:connect(function() local x = game.Lighting:GetMinutesAfterMidnight() if x > 1080 then A.CanCollide = false B.CanCollide = false C.CanCollide = false D.CanCollide = false E.CanCollide = false elseif x > 360 then A.CanCollide = true B.CanCollide = true C.CanCollide = true D.CanCollide = true E.CanCollide = true end end) -- switched it for you |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:34 AM |
I see, so I need to change the order?
|
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:35 AM |
| It should fix the logic error. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:38 AM |
game.Lighting.Changed:connect(function() local x = game.Lighting:GetMinutesAfterMidnight() if x > 360 and x < 1080 then A.CanCollide = true B.CanCollide = true C.CanCollide = true D.CanCollide = true E.CanCollide = true elseif x > 1080 then A.CanCollide = false B.CanCollide = false C.CanCollide = false D.CanCollide = false E.CanCollide = false end end) |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2013 11:39 AM |
Seems to have worked. Note to self; Greater values come first. :s |
|
|
| Report Abuse |
|
|