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

Why does the studio not recognise '=='?

Asked by 8 years ago

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 <string>, got '=='

0
Please post your code in a code block (lua icon) TheHospitalDev 1134 — 8y
0
alright, thanks Silverstar13 0 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago
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
0
thank you so much Silverstar13 0 — 8y
Ad

Answer this question