Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

3 comments

0

Scripting isn't about learning about every way to do a particular thing. Its about learning how do it and do it EFFICENTLY

0

Well I just want to know every function and how it works really, And I will be able to code Alright after that.

0

read my answer

1 answer

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.

2 comments

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.

0

to do that if it was then just put "else" and +1 me :D

This discussion is preserved as it was. New answers, comments, and votes are closed.