Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Did I use the Statement "then if not" right?

Asked by
IcyEvil 260 Moderation Voter
10 years ago

And I am trying to make the game To the lighting Time of "20:00:00" But without using the


while true do wait() if game.Lighting.TimeOfDay == ("14:00:00") then game.Lighting.TimeOfDay = ("20:00:00") end end

``

method

while true do
    wait()
    if game.Lighting.TimeOfDay == ("20:00:00")
then if not game.Lighting.TimeOfDay == ("20:00:00")
    then wait(23.0)
    end
    end
end

This is my code ( The Above ) I am trying to Learn coding By myself but I could use some help every so often.

0
Scripting isn't about learning about every way to do a particular thing. Its about learning how do it and do it EFFICENTLY TochiWasHere 10 — 10y
0
Well I just want to know every function and how it works really, And I will be able to code Alright after that. IcyEvil 260 — 10y
0
read my answer TochiWasHere 10 — 10y

1 answer

Log in to vote
-1
Answered by 10 years ago

No + then if not means if it doesnt meet the condition so you could just use..

if game.Lighting.TimeOfDay ~= "20:00:00" then
    --blah
end

Plus the second script you showed wouldn't really work because it would need the time to be 20:00:00 to execute the if not then statement which means if it needs to NOT meet the condition but yet it needs to meet it so it can even execute it as shown in the first if statement.

0
I thought the "then if not" meant if it Wasnt that already but it said I had to have then 2x so I had put that there. IcyEvil 260 — 10y
0
to do that if it was then just put "else" and +1 me :D TochiWasHere 10 — 10y
Ad

Answer this question