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

Why does the studio not recognise '=='?

I'm an idiot, and I don't know why there's an error on '=='.

my code:

lightpart = game.Workspace.Lightpart minutesAfterMidnight = 0 while true do minutesAfterMidnight = minutesAfterMidnight+10 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) if game.Lighting:GetMinutesAfterMidnight == 6*60 then lightpart.Material = Enum.Material.Plastic lightpart.PointLight.Enabled = false end wait(.1) end

But it says: Error: (7,43) Expected '(', '{' or , got '=='

2 comments

0

Please post your code in a code block (lua icon)

0

alright, thanks

1 answer

lightpart = game.Workspace.Lightpart 
minutesAfterMidnight = 0 
while true do 
	minutesAfterMidnight = minutesAfterMidnight+10 
	game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight) 
	if game.Lighting:GetMinutesAfterMidnight() == 6*60 then --GetMinutesAfterMidnight MUST have () after it.
		lightpart.Material = Enum.Material.Plastic 
		lightpart.PointLight.Enabled = false 
	end 
	wait(.1)
end

1 comment

0

thank you so much

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